UNPKG

unified-query

Version:

Composable search input with autocompletion and a rich query-language parser for the Unified Data System

13 lines (12 loc) 328 B
/** Matches literal `true` or `false` (lower-case, spec-exact). */ export const booleanParser = (word, pos) => { if (word !== 'true' && word !== 'false') return null; return { kind: 'boolean', value: word === 'true', raw: word, from: pos, to: pos + word.length, }; };