Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jora

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jora - npm Package Versions

13

1.0.0-beta.3

Diff

Changelog

Source

1.0.0-beta.3 (September 20, 2020)

  • Improved sort() to be stable for mixed types (#17)
  • Added ascN and descN to define natural sorting functions
  • Added ascA and descA to define sorting functions with reverse order for numbers
  • Added ascAN and descAN to define natural sorting functions with reverse order for numbers h
  • Improved suggestion for pipeline operator in malformed query (tolerant mode)
  • Added suggestion for object keys in bracket notation property accessor
  • Renamed node type Property to ObjectEntry
lahmatiy
published 1.0.0-beta.2 •

Changelog

Source

1.0.0-beta.2 (May 17, 2020)

  • Fixed parse error handling
lahmatiy
published 1.0.0-beta.1 •

Changelog

Source

1.0.0-beta.1 (May 14, 2020)

  • Added [...expr] syntax
  • Added $$ root reference (arg1), which refers to second parameter of closest function or undefined when 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 syntax.walk() API method to traverse AST
  • Allowed numbers without integer part, i.e. .123 or .5e-4
  • Allowed numbers and literals as property name in object literals, i.e. { 1: 'ok', null: 'ok' }
  • Changed = and != operators to use Object.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 bracket notation (i.e. foo[expr]) to behave like pick() 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 undefined for object, return first entry value instead of value with key undefined
    • Cast boolean values to a number index when access to an array or string, i.e. false -> 0 and true -> 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, use entries().({ 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, has and has no which was added (e.g. in query ["a", "b", 1, 2][$ in ["b", 2]] jora will suggest only "a" and 1 values in array after in operator)
lahmatiy
published 1.0.0-alpha.13 •

Changelog

Source

1.0.0-alpha.13 (January 6, 2020)

  • Added pipeline operator, i.e. foo | bar | ...
  • Added fromEntries() method
  • Allowed parent's scope variables overlapping, i.e. $a;.($a; ...) doesn't throw with an error now
  • Added support for a function as debug option value, i.e. query('...', { debug: (name, value) => /* ... */ })
  • Disallowed whitespace between $ and identifier, previously $foo can be used as $ foo, now it throws with a parse error
  • Reworked build setup:
    • Added baking of src/parser.js before publishing, i.e. replace a runtime parser compilation with a pre-compiled version
    • Moved jison to dev dependencies, and package has no dependencies anymore (dev only)
    • Removed dist/parser.js & dist/version.json from package
lahmatiy
published 1.0.0-alpha.12 •

Changelog

Source

1.0.0-alpha.12 (December 18, 2019)

  • Included build prerequisite files (dist/parser.js & dist/version.json) in package
lahmatiy
published 1.0.0-alpha.11 •

Changelog

Source

1.0.0-alpha.11 (December 17, 2019)

  • Reworked parsing to produce AST, other parts reworked to consume AST as well
  • Exposed syntax interface with 3 methods: syntax.parse(source, tolerantMode), syntax.compile(ast, suggestRanges, statMode) and syntax.stringify(ast)
  • Added slice notation like proposed for adding to JavaScript, e.g. $str: '<foo>'; str[1:-1] ('foo') or $ar:[1,2,3,4,5,6]; $ar[-3::-1] ([6,5,4]) (#11)
  • Added slice(from, to) method
  • Added split(pattern) method
  • Added join(separator) method
  • Added match(pattern, matchAll) method
  • Fixed method invocation on recursive mapping, i.e. ..method() doesn't raise an error now and works as expected without surrounding parentheses (#10)
  • Allowed definitions to use in parentheses, e.g. ($a: 1; $a + $a)
  • Added a function definition via =>, i.e. => body
  • Added sorting function definition with asc and desc keywords, e.g. sort(foo asc), $sorting: foo desc; sort($sorting) or sort(foo desc, bar asc)
  • Changed sort() method to use a two argument function as a regular comparator
  • Removed ::self syntax, recursion with a function defined by a variable should be used instead
lahmatiy
published 1.0.0-alpha.10 •

Changelog

Source

1.0.0-alpha.10 (March 7, 2019)

  • Fixed arguments context suggestion for chained methods with no arguments
lahmatiy
published 1.0.0-alpha.9 •

Changelog

Source

1.0.0-alpha.9 (March 5, 2019)

  • Added support for numbers with exponent
  • Added support for strings as property name in object literals
  • Fixed edge cases with suggestions around keywords and inside functions
  • Allowed - and + operators to be unary
  • Renamed get buildin method to map
  • Changed ~= operator to take any value as tester (not a regexp only); when value is a function it's behaves like filter(), when null or undefined it's always truthy otherwise falsy
  • Changed group() method to group by an element when key value is an array
lahmatiy
published 1.0.0-alpha.8 •

Changelog

Source

1.0.0-alpha.8 (February 7, 2019)

  • Reworked tolerant parsing mode, less failures and better suggestions
  • Reworked lib building, lib size reduced from 71Kb to 39Kb
  • Fixed a function parsing, now it's greedy and a parentheses needed only around expressions with > operator when used outside braces, since > will end a function definition (i.e. <a > 20> causes to a parse error, but <(a > 20)> or <foo.[a > 20]> is not)
  • Allowed a block inside a function, i.e. function can be empty (returns a current in this case) and definitions are allowed in function's body
  • Added has and has no operators as inverse of in and not in
  • Fixed and and or operators to evaluate left expression only once (good for performance and eliminates duplicates in suggestions)
lahmatiy
published 1.0.0-alpha.7 •

Changelog

Source

1.0.0-alpha.7 (December 25, 2018)

  • Disallowed a whitespace between a dot and a bracket in .[, .( and ..( tokens
  • Changed filtering (i.e. .[] or filter() method) behaviour for a non-array value to return a value itself when expression is truthy or undefined otherwise
  • Changed semanthic jora(query, methods?, debug?) -> jora(query, options?) where options is { methods?, debug? }
  • Added stat mode (turns on by stat option, i.e. jora(query, { stat: true })) to return a query stat interface (an object { stat(), suggestion() }) instead of resulting data
  • Added tolerant parse mode (turns on by tolerant option, i.e. jora(query, { tolerant: true })) to supress parsing errors when possible
  • Added library version to export
  • Fixed parser edge cases for division (/) and regexp
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc