Simple module for ensuring specific options are passed to a function
Last updated a year ago by liuis .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install truffle-conflux-expect 
SYNC missed versions from official npm registry.


Simple module for ensuring expected parameters exist


$ npm install truffle-conflux-expect


const expect = require("truffle-conflux-expect");

// the object you're testing
const options = {
  example: "exists",
  another: 5

expect.options(options, ["example", "another"]); // does nothing because both key values exist
expect.options(options, ["example", "another", "some_other_key"]); // errors because options["some_other_key"] is undefined, ["example", "optional_key"]); // does nothing because at least one key value exists, ["optional_key", "other_optional_key"]); // errors because both key values are undefined

Current Tags

  • 0.0.2-alpha.0                                ...           latest (a year ago)

1 Versions

  • 0.0.2-alpha.0                                ...           a year ago

Copyright 2014 - 2016 © |