Socket
Socket
Sign inDemoInstall

doc-path

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

doc-path - npm Package Compare versions

Comparing version 4.0.0-beta.0 to 4.0.0-beta.1

8

lib/path.js

@@ -18,6 +18,6 @@ /**

const { dotIndex, key, remaining } = state(kp);
const kpVal = kp in obj ? obj[kp] : null;
const kpVal = typeof obj === 'object' && kp in obj ? obj[kp] : null;
const keyVal = key in obj ? obj[key] : null;
// If there is a '.' in the key path and the key path doesn't appear in the object, recur on the subobject
if (dotIndex >= 0 && !kpVal) {
if (dotIndex >= 0 && typeof obj === 'object' && !(kp in obj)) {
// If there's an array at the current key in the object, then iterate over those items evaluating the remaining path

@@ -34,7 +34,7 @@ if (Array.isArray(keyVal)) {

}
else if (dotIndex >= 0 && kp !== key && keyVal) {
else if (dotIndex >= 0 && kp !== key && typeof obj === 'object' && key in obj) {
// If there's a field with a non-nested dot, then recur into that sub-value
return evaluatePath(keyVal, remaining);
}
else if (dotIndex === -1 && keyVal && !kpVal) {
else if (dotIndex === -1 && typeof obj === 'object' && key in obj && !(kp in obj)) {
// If the field is here, but the key was escaped

@@ -41,0 +41,0 @@ return keyVal;

@@ -5,3 +5,3 @@ {

"description": "A document path library for Node",
"version": "4.0.0-beta.0",
"version": "4.0.0-beta.1",
"homepage": "https://mrodrig.github.io/doc-path",

@@ -8,0 +8,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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