npm

validate-expression

1.0.3 • Public • Published

validate-expression

Build Status

Install

$ npm install --save validate-expression

Usage

const { validateExpression } = require('validate-expression')

Example

const { validateExpression } = require('validate-expression')
let expression1 = '1&&2&3|4||5 & !(6|7)'
let expression2 = '1&&2&3|4||5! & !(6|7)'
let ret1 = validateExpression(expression1) //true
let ret2 = validateExpression(expression1, [1,2,3,4,5,6,7]) //true
let ret3 = validateExpression(expression1, [1,2,3,4,7]) //false
let ret4 = validateExpression(expression2) //false

Package Sidebar

Install

npm i validate-expression

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

103 kB

Total Files

6

Last publish

Collaborators

  • junda.mao