boolean-json-bifurcate

0.1.2 • Public • Published
var assert = require('assert')
var bifurcate = require('boolean-json-bifurcate')
 
assert.deepEqual(
  bifurcate({and: ['p', 'q']}),
  {and: ['p', 'q']}
)
 
assert.deepEqual(
  bifurcate({and: ['p', 'q', 'r', 's']}),
  {and: ['p', {and: ['q', {and: ['r', 's']}]}]}
)
 
assert.deepEqual(
  bifurcate({or: ['p', 'q', 'r', 's']}),
  {or: ['p', {or: ['q', {or: ['r', 's']}]}]}
)
 
assert.deepEqual(
  bifurcate({not: {or: [{not: 'p'}, 'q', 'r']}}),
  {not: {or: [{not: 'p'}, {or: ['q', 'r']}]}}
)

Readme

Keywords

none

Package Sidebar

Install

npm i boolean-json-bifurcate

Weekly Downloads

202

Version

0.1.2

License

MIT

Last publish

Collaborators

  • kemitchell