boolean-json-variables

2.0.4 • Public • Published
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']
)

Package Sidebar

Install

npm i boolean-json-variables

Weekly Downloads

1

Version

2.0.4

License

MIT

Last publish

Collaborators

  • kemitchell