Comparing version 1.3.1 to 1.3.2
{ | ||
"name": "factory-js", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "Building JavaScript objects inspired by rosie and factory_girl", | ||
@@ -5,0 +5,0 @@ "main": "./dist/factory.js", |
@@ -10,10 +10,9 @@ # Factory [![Build Status](https://travis-ci.org/tb/factory.svg)](https://travis-ci.org/tb/factory) | ||
Factory | ||
.define('vote') | ||
.sequence('id'); | ||
.attr('value', 0); | ||
Factory.define('vote') | ||
.sequence('id') | ||
.attr('value', 0) | ||
.trait('up', function() { | ||
return this.attr('value', 1); | ||
}); | ||
this.trait('down', function() { | ||
}) | ||
.trait('down', function() { | ||
return this.attr('value', -1); | ||
@@ -23,8 +22,8 @@ }); | ||
Factory.define('post') | ||
.sequence('id'); | ||
.sequence('id') | ||
.sequence('title', function(i) { | ||
return "Post " + i; | ||
}); | ||
.attr('content', null); | ||
.hasMany('votes', 'vote'); | ||
}) | ||
.attr('content', null) | ||
.hasMany('votes', 'vote') | ||
.after(function() { | ||
@@ -37,7 +36,7 @@ if (!this.content) { | ||
Factory.define('category') | ||
.sequence('id'); | ||
.sequence('id') | ||
.sequence('name', function(i) { | ||
return "Category " + i; | ||
}); | ||
.ignore('postsCount', 0); | ||
}) | ||
.ignore('postsCount', 0) | ||
.after(function(attributes) { | ||
@@ -44,0 +43,0 @@ return this.posts = Factory.buildList('post', attributes.postsCount); |
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
factory.ts |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43072
157
1