New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

factor-in

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
Version published
Maintainers
1
Created

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

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