js-pointer
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -13,11 +13,11 @@ 'use strict'; | ||
function get(doc, pointer) { | ||
return traverse(doc, parse(pointer)); | ||
function get(obj, pointer) { | ||
return traverse(obj, parse(pointer)); | ||
} | ||
function traverse(doc, tokens) { | ||
if (!tokens.length) return doc; | ||
function traverse(obj, tokens) { | ||
if (!tokens.length) return obj; | ||
var next = tokens.shift(); | ||
return traverse(doc[next], tokens); | ||
return traverse(obj[next], tokens); | ||
} | ||
@@ -39,3 +39,3 @@ | ||
function unescape(token) { | ||
return token.replace('~1', '/').replace('~0', '~'); | ||
return token.replace(/~1/g, '/').replace(/~0/g, '~'); | ||
} | ||
@@ -42,0 +42,0 @@ |
{ | ||
"name": "js-pointer", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Tiny, spec compliant JSON Pointer RFC 6901 implementation.", | ||
@@ -37,3 +37,3 @@ "main": "dist/index.js", | ||
"babel-core": "^6.7.7", | ||
"babel-plugin-istanbul": "^2.0.0", | ||
"babel-plugin-istanbul": "^3.0.0", | ||
"babel-preset-es2015": "^6.6.0", | ||
@@ -40,0 +40,0 @@ "babel-register": "^6.11.5", |
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
6561