2.0.4 • Published 7 years ago

boolean-json-variables v2.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago
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']
)