UNPKG

filter-expressions

Version:

Basic array structure that can conditionally validate objects

33 lines (23 loc) 1.35 kB
# Changelog ## v2. Goals: - Keep portability of JSON declaration - Compile to optimised javascript ### Breaking changes - "==" is now equivalent of "===" comparison, and is not a deep comparison, for deep comparisons use "equals" - "<=", "<", ">", ">=" will now ensure that the types are equivalent - "match" is now "to-regex" and "regex-test" for regular expression matching: ["match", "prop", "^[A-Z]+$", "i"] becomes ["regex-test", "prop", ["to-regex", "^[A-Z]+$", "i"]] - "date" is now "to-date" - Removed support for "geo" based comparisons, to be implemented as optional instruction sets - Removed comparison and operator options. These are replaced by implementing instructions - When selecting a property from the context object, include \$varname opposed to just "varname" (which is the same as calling ["get", "varname"]) ### New features - "!" negate - type casting support, "to-date", "to-boolean", "to-string", "to-number" and "typeof" - "equals", "equal", "!equal", "!equals" for deep compare object (using lodash.isequal) - "<", ">", "!=", "==", "<=", ">=" Compares dates - "lowercase", "downcase", "uppercase", "upcase" to transform text case - "length" for length of array and strings - Optional instructions. Provide your own function implementations ### Improvements - Removes switch statements in favour of a register