Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hyperjump/json-pointer

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

@hyperjump/json-pointer - npm Package Compare versions

Comparing version 0.7.0 to 0.8.0

18

lib/json-pointer.js

@@ -119,12 +119,12 @@ const curry = require("just-curry-it");

const applySegment = (value, segment, cursor = "") => {
if (isScalar(value)) {
throw Error(`Value at '${cursor}' is a scalar and can't be indexed`);
if (value === undefined) {
throw TypeError(`Value at '${cursor}' is undefined and does not have property '${segment}'`);
} else if (value === null) {
throw TypeError(`Value at '${cursor}' is null and does not have property '${segment}'`);
} else if (isScalar(value)) {
throw TypeError(`Value at '${cursor}' is a ${typeof value} and does not have property '${segment}'`);
} else {
const computedSegment = computeSegment(value, segment);
return value[computedSegment];
}
const computedSegment = computeSegment(value, segment);
if (!(computedSegment in value)) {
throw Error(`Value at '${cursor}' does not have index '${computedSegment}'`);
}
return value[computedSegment];
};

@@ -131,0 +131,0 @@

{
"name": "@hyperjump/json-pointer",
"version": "0.7.0",
"version": "0.8.0",
"description": "An RFC-6901 JSON Pointer implementation",

@@ -8,3 +8,3 @@ "main": "lib/json-pointer.js",

"clean": "xargs -a .gitignore rm -rf",
"lint": "eslint .",
"lint": "eslint lib",
"test": "mocha 'lib/**/*.spec.js'"

@@ -23,3 +23,3 @@ },

"eslint-import-resolver-node": "^0.3.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.20.2",
"mocha": "^5.2.0"

@@ -26,0 +26,0 @@ },

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