Comparing version 0.2.2 to 0.2.3
@@ -157,3 +157,4 @@ var aesprim = require('./aesprim'); | ||
Handlers.prototype._fns['member-descendant-numeric_literal'] = | ||
Handlers.prototype._fns['member-descendant-identifier']; | ||
Handlers.prototype._fns['subscript-descendant-string_literal'] = | ||
Handlers.prototype._fns['member-descendant-identifier']; | ||
@@ -160,0 +161,0 @@ function eval_recurse(partial, src, template) { |
{ | ||
"name": "jsonpath", | ||
"description": "Query JavaScript objects with JSONPath expressions. Robust / safe JSONPath engine for Node.js.", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"author": "david@fmail.co.uk", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -39,2 +39,10 @@ var assert = require('assert'); | ||
test('parse path for all authors via subscript descendant string literal', function() { | ||
var path = jp.parse("$..['author']"); | ||
assert.deepEqual(path, [ | ||
{ expression: { type: 'root', value: '$' } }, | ||
{ operation: 'subscript', scope: 'descendant', expression: { type: 'string_literal', value: 'author' } } | ||
]) | ||
}); | ||
test('parse path for all things in store', function() { | ||
@@ -41,0 +49,0 @@ var path = jp.parse('$.store.*'); |
@@ -33,2 +33,12 @@ var assert = require('assert'); | ||
test('all authors via subscript descendant string literal', function() { | ||
var results = jp.nodes(data, "$..['author']"); | ||
assert.deepEqual(results, [ | ||
{ path: ['$', 'store', 'book', 0, 'author'], value: 'Nigel Rees' }, | ||
{ path: ['$', 'store', 'book', 1, 'author'], value: 'Evelyn Waugh' }, | ||
{ path: ['$', 'store', 'book', 2, 'author'], value: 'Herman Melville' }, | ||
{ path: ['$', 'store', 'book', 3, 'author'], value: 'J. R. R. Tolkien' } | ||
]); | ||
}); | ||
test('all things in store', function() { | ||
@@ -35,0 +45,0 @@ var results = jp.nodes(data, '$.store.*'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7711
386804
30