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.1.2 to 0.1.3

9

lib/handlers.js

@@ -37,4 +37,9 @@ var aesprim = require('./aesprim');

'member-child-identifier':
_descend(function(key, value, ref) { return key == ref }),
'member-child-identifier': function(component, partial) {
var key = component.expression.value;
var value = partial.value;
if (value instanceof Object && key in value) {
return [ { value: value[key], path: partial.path.concat(key) } ]
}
},

@@ -41,0 +46,0 @@ 'member-descendant-identifier':

@@ -180,3 +180,3 @@ var assert = require('assert');

if (typeof component == "string" && component.match(dict.identifier)) {
if (typeof component == "string" && component.match("^" + dict.identifier + "$")) {

@@ -183,0 +183,0 @@ _path.push({

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

@@ -24,3 +24,13 @@ "scripts": {

},
"keywords": [
"JSONPath",
"jsonpath",
"json-path",
"object",
"traversal",
"json",
"path",
"data structures"
],
"license": "MIT"
}

@@ -24,2 +24,9 @@ [![Build Status](https://travis-ci.org/dchester/jsonpath.png?branch=master)](https://travis-ci.org/dchester/jsonpath)

## Install
Install from npm:
```bash
$ npm install jsonpath
```
## JSONPath Syntax

@@ -26,0 +33,0 @@

@@ -31,2 +31,7 @@ var assert = require('assert');

test('keys with hyphens get subscripted', function() {
var string = jp.stringify(['$', 'member-search']);
assert.equal(string, '$["member-search"]');
});
test('complicated path round trips', function() {

@@ -33,0 +38,0 @@ var pathExpression = '$..*[0:2].member["string-xyz"]';

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