Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// models/todos-fixture.js
import { fixture } from "can";
import Todo from "./todo";
const todoStore = fixture.store(
[
{ name: "mow lawn", complete: false, id: "5" },
{ name: "dishes", complete: true, id: "6" },
{ name: "learn canjs", complete: false, id: "7" }
],
Todo
);
fixture("/api/todos/{id}", todoStore);
fixture.delay = 500;
export default todoStore;
import { fixture } from 'can';
import City from '../city';
const store = fixture.store([
{ state: 'CA', name: 'Casadina' },
{ state: 'NT', name: 'Alberny' }
], City.connection.queryLogic);
fixture('/api/cities/{name}', store);
export default store;
import { fixture } from 'can';
import State from '../state';
const store = fixture.store([
{ name: 'Calisota', short: 'CA' },
{ name: 'New Troy', short: 'NT'}
], State.connection.queryLogic);
fixture('/api/states/{short}', store);
export default store;
{ id: "1", name: "Ford" },
{ id: "2", name: "Nissan" }
],
{ identity: ["id"] }
));
fixture("/models", fixture.store([
{ id: "1", makeId: "1", name: "Mustang", years: [ 2013, 2014 ] },
{ id: "2", makeId: "1", name: "Focus", years: [ 2013, 2014 ] },
{ id: "3", makeId: "2", name: "Altima", years: [ 2013, 2014 ] },
{ id: "4", makeId: "2", name: "Leaf", years: [ 2013, 2014 ] },
],
{ identity: ["id"] }
));
fixture("/vehicles", fixture.store([
{id: 1, modelId: "1", year: "2013", name: "2013 Mustang", thumb: "http://mustangsdaily.com/blog/wp-content/uploads/2012/07/01-2013-ford-mustang-gt-review-585x388.jpg"},
{id: 2, modelId: "1", year: "2014", name: "2014 Mustang", thumb: "http://mustangsdaily.com/blog/wp-content/uploads/2013/03/2014-roush-mustang.jpg"},
{id: 3, modelId: "2", year: "2013", name: "2013 Focus", thumb: "http://images.newcars.com/images/car-pictures/original/2013-Ford-Focus-Sedan-S-4dr-Sedan-Exterior.png"},
{id: 4, modelId: "2", year: "2014", name: "2014 Focus", thumb: "http://ipinvite.iperceptions.com/Invitations/survey705/images_V2/top4.jpg"},
{id: 5, modelId: "3", year: "2013", name: "2013 Altima", thumb: "http://www.blogcdn.com/www.autoblog.com/media/2012/04/04-2013-nissan-altima-1333416664.jpg"},
{id: 6, modelId: "3", year: "2014", name: "2014 Altima", thumb: "http://www.blogcdn.com/www.autoblog.com/media/2012/04/01-2013-nissan-altima-ny.jpg"},
{id: 7, modelId: "4", year: "2013", name: "2013 Leaf", thumb: "http://www.blogcdn.com/www.autoblog.com/media/2012/04/01-2013-nissan-altima-ny.jpg"},
{id: 8, modelId: "4", year: "2014", name: "2014 Leaf", thumb: "http://images.thecarconnection.com/med/2013-nissan-leaf_100414473_m.jpg"},
],
{ identity: ["id"] }
));
class MyMmy extends StacheElement {
static view = `
<select></select>
import { fixture } from 'can';
import Order from '../order';
const store = fixture.store([{
_id: 0,
description: 'First item'
}, {
_id: 1,
description: 'Second item'
}], Order.connection.queryLogic);
fixture('/api/orders/{_id}', store);
export default store;
url: "string"
});
Website.List = DefineList.extend({
"#": Website,
count: "number"
});
realtimeRestModel({
Map: Website,
List: Website.List,
url: "/websites"
});
const websiteStore = fixture.store([{
id: 1,
name: "CanJS",
url: "http://canjs.us"
}, {
id: 2,
name: "jQuery++",
url: "http://jquerypp.com"
}, {
id: 3,
name: "JavaScriptMVC",
url: "http://javascriptmvc.com"
}, {
id: 4,
name: "Bitovi",
url: "http://bitovi.com"
}, {
import { fixture } from 'can';
import Order from '../order';
const store = fixture.store([{
_id: 0,
description: 'First item'
}, {
_id: 1,
description: 'Second item'
}], Order.connection.algebra);
fixture('/api/orders/{_id}', store);
export default store;
import { fixture } from 'can';
import Restaurant from '../restaurant';
const store = fixture.store([{
_id: 1,
name: 'Cheese City',
slug:'cheese-city',
address: {
city: 'Casadina',
state: 'CA'
},
images: {
banner: "node_modules/place-my-order-assets/images/1-banner.jpg",
owner: "node_modules/place-my-order-assets/images/2-owner.jpg",
thumbnail: "node_modules/place-my-order-assets/images/3-thumbnail.jpg"
}
}, {
_id: 2,
name: 'Crab Barn',
slug:'crab-barn',
import { fixture } from 'can';
import City from '../city';
const store = fixture.store([
{ state: 'CA', name: 'Casadina' },
{ state: 'NT', name: 'Alberny' }
], City.connection.queryLogic);
fixture('/api/cities/{name}', store);
export default store;
import { fixture } from 'can';
import State from '../state';
const store = fixture.store([
{ name: 'Calisota', short: 'CA' },
{ name: 'New Troy', short: 'NT'}
], State.connection.queryLogic);
fixture('/api/states/{short}', store);
export default store;