npm.io
1.1.2 • Published 3 years ago

@astronautlabs/jsonpath

Licence
MIT
Version
1.1.2
Deps
1
Size
1.6 MB
Vulns
0
Weekly
0
Stars
12

@/jsonpath CircleCI

npm (scoped)

Query JavaScript objects with JSONPath expressions. Robust / safe JSONPath engine for Node.js.

Query Example

import { JSONPath } from '@astronautlabs/jsonpath';

let cities = [
  { name: "London", "population": 8615246 },
  { name: "Berlin", "population": 3517424 },
  { name: "Madrid", "population": 3165235 },
  { name: "Rome",   "population": 2870528 }
];

let names = JSONPath.query(cities, '$..name');

// [ "London", "Berlin", "Madrid", "Rome" ]

Install

Install from npm:

$ npm install @astronautlabs/jsonpath

JSONPath Syntax

Here are syntax and examples adapted from Stefan Goessner's original post introducing JSONPath in 2007.

JSONPath Description
$ The root object/element
@ The current object/element
. Child member operator
.. Recursive descendant operator; JSONPath borrows this syntax from E4X
* Wildcard matching all objects/elements regardless their names
[] Subscript operator
[,] Union operator for alternate names or array indices as a set
[start:end:step] Array slice operator borrowed from ES4 / Python
?() Applies a filter (script) expression via static evaluation
() Script expression via static evaluation

Given this sample data set, see example expressions below:

{
  "store": {
    "book": [ 
      {
        "category": "reference",
        "author": "Nigel Rees",
        "title": "Sayings of the Century",
        "price": 8.95
      }, {
        "category": "fiction",
        "author": "Evelyn Waugh",
        "title": "Sword of Honour",
        "price": 12.99
      }, {
        "category": "fiction",
        "author": "Herman Melville",
        "title": "Moby Dick",
        "isbn": "0-553-21311-3",
        "price": 8.99
      }, {
         "category": "fiction",
        "author": "J. R. R. Tolkien",
        "title": "The Lord of the Rings",
        "isbn": "0-395-19395-8",
        "price": 22.99
      }
    ],
    "bicycle": {
      "color": "red",
      "price": 19.95
    }
  }
}

Example JSONPath expressions:

JSONPath Description
$.store.book[*].author The authors of all books in the store
$..author All authors
$.store.* All things in store, which are some books and a red bicycle
$.store..price The price of everything in the store
$..book[2] The third book
$..book[(@.length-1)] The last book via script subscript
$..book[-1:] The last book via slice
$..book[0,1] The first two books via subscript union
$..book[:2] The first two books via subscript array slice
$..book[?(@.isbn)] Filter all books with isbn number
$..book[?(@.price<10)] Filter all books cheaper than 10
$..book[?(@.price==8.95)] Filter all books that cost 8.95
$..book[?(@.price<30 && @.category=="fiction")] Filter all fiction books cheaper than 30
$..* All members of JSON structure

Methods

JSONPath.query(obj, pathExpression[, count])

Find elements in obj matching pathExpression. Returns an array of elements that satisfy the provided JSONPath expression, or an empty array if none were matched. Returns only first count elements if specified.

let authors = jp.query(data, '$..author');
// [ 'Nigel Rees', 'Evelyn Waugh', 'Herman Melville', 'J. R. R. Tolkien' ]
JSONPath.paths(obj, pathExpression[, count])

Find paths to elements in obj matching pathExpression. Returns an array of element paths that satisfy the provided JSONPath expression. Each path is itself an array of keys representing the location within obj of the matching element. Returns only first count paths if specified.

let paths = jp.paths(data, '$..author');
// [
//   ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in obj matching pathExpression. Returns an array of node objects where each node has a path containing an array of keys representing the location within obj, and a value pointing to the matched element. Returns only first count nodes if specified.

let nodes = jp.nodes(data, '$..author');
// [
//   { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching pathExpression. If newValue is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function fn on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

let nodes = jp.apply(data, '$..author', function(value) { return value.toUpperCase() });
// [
//   { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

let path = jp.parse('$..author');
// [
//   { expression: { type: 'root', value: '
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by jp.nodes for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by jp.parse.

let pathExpression = jp.stringify(['

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, (...) and ?(...)) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (@), and only simple expressions (with no side effects) will be valid. So for example, ?(@.length>10) will be just fine to match arrays with more than ten elements, but ?(process.exit()) will not get evaluated since process would yield a ReferenceError. This method is even safer than vm.runInNewContext, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., $['store] => $['store']), and in other cases, can be just plain wrong (e.g. [ => $).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final step arguments in slice operators may now be negative
  • script expressions may now contain . and @ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., $[' instead of $.$)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' },
// { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' },
// { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' },
// { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' }
// ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

} }, // { expression: { type: 'identifier', value: 'author' }, operation: 'member', scope: 'descendant' } // ]
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author']); // "$.store.book[0].author"

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

} }, // { expression: { type: 'identifier', value: 'author' }, operation: 'member', scope: 'descendant' } // ]
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 0, 'author'] }, // ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 1, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 2, 'author'] },
// ['
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

, 'store', 'book', 3, 'author'] }
// ]
JSONPath.nodes(obj, pathExpression[, count])

Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

__CODE_BLOCK_5__
JSONPath.value(obj, pathExpression[, newValue])

Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

JSONPath.parent(obj, pathExpression)

Returns the parent of the first matching element.

JSONPath.apply(obj, pathExpression, fn)

Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

__CODE_BLOCK_6__
JSONPath.parse(pathExpression)

Parse the provided JSONPath expression into path components and their associated operations.

__CODE_BLOCK_7__
JSONPath.stringify(path)

Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

__CODE_BLOCK_8__

Differences from Original Implementation

This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

Evaluating Script Expressions

Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

Grammar

This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

Other Minor Differences

As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

  • strings in subscripts may now be double-quoted
  • final __INLINE_CODE_54__ arguments in slice operators may now be negative
  • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
  • subscripts no longer act as character slices on string elements
  • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results

License

MIT

] instead of __INLINE_CODE_58__)
  • unions now yield real unions with no duplicates rather than concatenated results
  • License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    } }, // { expression: { type: 'identifier', value: 'author' }, operation: 'member', scope: 'descendant' } // ]
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author']); // "$.store.book[0].author"

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    } }, // { expression: { type: 'identifier', value: 'author' }, operation: 'member', scope: 'descendant' } // ]
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'NIGEL REES' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'EVELYN WAUGH' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'HERMAN MELVILLE' }, // { path: ['
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. TOLKIEN' } // ]
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'], value: 'Herman Melville' }, // { path: ['
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } // ]
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 0, 'author'] }, // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 1, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 2, 'author'] },
    // ['
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    , 'store', 'book', 3, 'author'] }
    // ]
    JSONPath.nodes(obj, pathExpression[, count])

    Find elements and their corresponding paths in __INLINE_CODE_31__ matching __INLINE_CODE_32__. Returns an array of node objects where each node has a __INLINE_CODE_33__ containing an array of keys representing the location within __INLINE_CODE_34__, and a __INLINE_CODE_35__ pointing to the matched element. Returns only first __INLINE_CODE_36__ nodes if specified.

    __CODE_BLOCK_5__
    JSONPath.value(obj, pathExpression[, newValue])

    Returns the value of the first element matching __INLINE_CODE_37__. If __INLINE_CODE_38__ is provided, sets the value of the first matching element and returns the new value.

    JSONPath.parent(obj, pathExpression)

    Returns the parent of the first matching element.

    JSONPath.apply(obj, pathExpression, fn)

    Runs the supplied function __INLINE_CODE_39__ on each matching element, and replaces each matching element with the return value from the function. The function accepts the value of the matching element as its only parameter. Returns matching nodes with their updated values.

    __CODE_BLOCK_6__
    JSONPath.parse(pathExpression)

    Parse the provided JSONPath expression into path components and their associated operations.

    __CODE_BLOCK_7__
    JSONPath.stringify(path)

    Returns a path expression in string form, given a path. The supplied path may either be a flat array of keys, as returned by __INLINE_CODE_40__ for example, or may alternatively be a fully parsed path expression in the form of an array of path components as returned by __INLINE_CODE_41__.

    __CODE_BLOCK_8__

    Differences from Original Implementation

    This implementation aims to be compatible with Stefan Goessner's original implementation with a few notable exceptions described below.

    Evaluating Script Expressions

    Script expressions (i.e, __INLINE_CODE_42__ and __INLINE_CODE_43__) are statically evaluated via static-eval rather than using the underlying script engine directly. That means both that the scope is limited to the instance variable (__INLINE_CODE_44__), and only simple expressions (with no side effects) will be valid. So for example, __INLINE_CODE_45__ will be just fine to match arrays with more than ten elements, but __INLINE_CODE_46__ will not get evaluated since __INLINE_CODE_47__ would yield a __INLINE_CODE_48__. This method is even safer than __INLINE_CODE_49__, since the script engine itself is more limited and entirely distinct from the one running the application code. See more details in the implementation of the evaluator.

    Grammar

    This project uses a formal BNF grammar to parse JSONPath expressions, an attempt at reverse-engineering the intent of the original implementation, which parses via a series of creative regular expressions. The original regex approach can sometimes be forgiving for better or for worse (e.g., __INLINE_CODE_50__ => __INLINE_CODE_51__), and in other cases, can be just plain wrong (e.g. __INLINE_CODE_52__ => __INLINE_CODE_53__).

    Other Minor Differences

    As a result of using a real parser and static evaluation, there are some arguable bugs in the original library that have not been carried through here:

    • strings in subscripts may now be double-quoted
    • final __INLINE_CODE_54__ arguments in slice operators may now be negative
    • script expressions may now contain __INLINE_CODE_55__ and __INLINE_CODE_56__ characters not referring to instance variables
    • subscripts no longer act as character slices on string elements
    • non-ascii non-word characters are no-longer valid in member identifier names; use quoted subscript strings instead (e.g., __INLINE_CODE_57__ instead of __INLINE_CODE_58__)
    • unions now yield real unions with no duplicates rather than concatenated results

    License

    MIT

    Keywords