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.4 to 0.2.5

5

lib/index.js

@@ -38,3 +38,6 @@ /* global toString */

var nodes = this.nodes(obj, string);
var nodes = this.nodes(obj, string).sort(function(a, b) {
// sort nodes so we apply from the bottom up
return b.path.length - a.path.length;
});

@@ -41,0 +44,0 @@ nodes.forEach(function(node) {

2

package.json
{
"name": "jsonpath",
"description": "Query JavaScript objects with JSONPath expressions. Robust / safe JSONPath engine for Node.js.",
"version": "0.2.4",
"version": "0.2.5",
"author": "david@fmail.co.uk",

@@ -6,0 +6,0 @@ "scripts": {

@@ -20,2 +20,10 @@ var assert = require('assert');

test('apply method applies survives structural changes', function() {
var data = {a: {b: [1, {c: [2,3]}]}};
jp.apply(data, '$..*[?(@.length > 1)]', function(array) {
return array.reverse();
});
assert.deepEqual(data.a.b, [{c: [3, 2]}, 1]);
});
test('value method gets us a value', function() {

@@ -22,0 +30,0 @@ var data = { a: 1, b: 2, c: 3, z: { a: 100, b: 200 } };

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