boolean-json-brute-force

3.0.1 • Public • Published
var solve = require('boolean-json-brute-force')

The package exports a function of one boolean-json argument. It returns an object map from variable name to boolean value.

var assert = require('assert')
 
assert.deepEqual(
  solve({and: ['a', 'b', 'c', 'd']}),
  {a: true, b: true, c: true, d: true}
)
 
assert.deepEqual(
  solve({and: ['a', {not: 'b'}, 'c']}),
  {a: true, b: false, c: true}
)

Or, if there is no solution, it returns undefined.

assert.deepEqual(
  solve({and: ['a', {not: 'a'}]}),
  undefined
)

/boolean-json-brute-force/

    Package Sidebar

    Install

    npm i boolean-json-brute-force

    Weekly Downloads

    3

    Version

    3.0.1

    License

    MIT

    Last publish

    Collaborators

    • kemitchell