1.0.0-beta.1
·
408 commits
to master
since this release
- Added
[...expr]syntax - Added
$$root reference (arg1), which refers to second parameter of closest function orundefinedwhen no such - Added
reduce()method - Added support for methods as a reference to definition's value, i.e.
$method: => 123; $method() or path.$method() - Added
walk()method to traverse AST - Allowed numbers without integer part, i.e.
.123or.5e-4 - Allowed numbers and literals as property name in object literals, i.e.
{ 1: 'ok', null: 'ok' } - Changed
=and!=operators to useObject.is()instead of===and!==operators - Changed behaviour for references to undefined definitions, now an exception raises in default mode, but no exceptions in tolerant mode
- Changed array-like access notation (i.e.
foo[expr]) to behave likepick()method - Reworked
pick()method:- Return first entry value when no argument gived
- String values are treat as an array
- Added support for negative indicies for array and strings
- Return a value for object and function as reference, instead of entry
- Pass index or key to function reference as second parameter (can be accessed by
$$) - When no arguments given or reference is
undefinedfor object, return first entry value instead of value with keyundefined - Cast boolean values to a number index when access to an array or string, i.e.
false->0andtrue->1
- Improved tolerant mode to not fail on methods that doesn't exists, such invocations silently returns
undefined - Improved parse and some compile errors
- Fixed suggestion in empty function body for new syntax, i.e.
group(=>)will suggest between=>and) - Fixed
~=operator to produce a boolean result only - Removed
mapToArray()method, useentries().({ nameProp: key, ...value })instead - Grand internal refactoring around AST processing:
- Parser generates less virtual nodes, so parse->stringify is much closer to original code (white spaces and comments mostly lost)
- Suggestion subsystem moved aside from parser to a separate module which uses in stat mode only
- Various fixes and improvements in suggestions
- The new approach allows to implement more complex suggestion scenarios like suggestions in array values for operators
in,not in,hasandhas nowhich was added (e.g. in query["a", "b", 1, 2][$ in ["b", 2]]jora will suggest only"a"and1values in array afterinoperator)