mattbishop / sql-jsonpath-js

JS implementation of the SQL/JSONPath dialect, from SQL2016.
MIT License
0 stars 0 forks source link

Add `lax` and `strict` mode keywords #7

Closed mattbishop closed 2 years ago

mattbishop commented 2 years ago

SQL JSONPath has an optional mode keyword of lax and strict. They go at the very start of an expression:

strict $ ...

lax $ ...

strict means the expressed paths must exist in the type they are expected to be. They should throw an error if not there.

Given:

{
  "first": "Matt",
  "last": "Bison"
}

This should throw an error: strict $.full

Whereas this should simply be undefined: lax $.full

lax is the default mode if none is specified.