boolean-json-variables
v2.0.4
Published
identify variables in boolean-json objects
Downloads
5
Maintainers
Readme
var variables = require('boolean-json-variables')
The package exports a function of one boolean-json argument. It returns an array of string variable names.
var assert = require('assert')
assert.deepEqual(
variables({
and: [
{or: ['w', 'x', 'y']},
{not: 'z'}
]
}).sort(),
['w', 'x', 'y', 'z']
)
assert.deepEqual(
variables({
and: [
{or: ['a', 'b', 'c', 'd']},
{and: ['a', 'c']}
]
}).sort(),
['a', 'b', 'c', 'd']
)