Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

factory-js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

factory-js - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

2

package.json
{
"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);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc