Licence
MIT
Version
0.0.3
Deps
0
Size
6 kB
Vulns
0
Weekly
0
is-query-valid
Performs query validation on field/variable list.
Validation includes brackets and double quotes
Get it
npm install --save is-query-valid
Usage
var isQueryValid = require('is-query-valid')
var arr = ['[absolutely]', ',[everybody]', ',[is]', ',[free]']
isQueryValid(arr, (err, isTrue) => {
if (err) throw err
console.log('Query Validator returns', isTrue)
})
// Query Validator returns true
API
isQueryValid(arr)
arr string array
Returns true if each matches query formatting rule and false if not
Rule: Any word is enclosed by double quotation marks or opening and closing brackets.