You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

factor-in

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

factor-in

Generate unique factory functions that return objects with inherited object data

1.1.0
Source
npmnpm
Version published
Weekly downloads
16
Maintainers
1
Weekly downloads
 
Created
Source

factor-in

NPM version build status Test coverage js-standard-style

Generate unique factory functions that return objects with inherited object data.
Useful for creating custom object data for unit tests.

Install

$ npm install --save factor-in

Usage

import factorIn from 'factor-in'

// Create our base object data we expect all
// factory functions to inherit from.
const f = factorIn ({
  foo () {},
  bar () {}
})

var obj = f ({ baz: 'Baz', qux: 'Qux' })
//=> {foo: foo(), bar: bar(), baz: 'Baz', qux: 'Qux'}

License

MIT © Chris Buttery

Keywords

javascript

FAQs

Package last updated on 06 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts