UNPKG

liqe

Version:

Lightweight and performant Lucene-like parser, serializer and search engine.

21 lines (20 loc) 624 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.testComparisonRange = void 0; const testComparisonRange = (query, value, operator) => { switch (operator) { case ':<': return value < query; case ':<=': return value <= query; case ':=': return value === query; case ':>': return value > query; case ':>=': return value >= query; default: throw new Error(`Unimplemented comparison operator: ${operator}`); } }; exports.testComparisonRange = testComparisonRange;