Socket
Socket
Sign inDemoInstall

jsonpath

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonpath - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

3

lib/handlers.js

@@ -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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc