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

pickr

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pickr - npm Package Compare versions

Comparing version 0.1.0 to 0.1.2

tests/transform.js

30

index.js

@@ -94,3 +94,31 @@ "use strict";

return result;
}
},
transform: function(context, path, fn) {
var pathParts = path.split('.'),
lastPathIndex = pathParts.length - 1,
pointer = context;
pathParts.every(function(attribute, pathIndex) {
if (isList(pointer)) {
pointer.forEach(function(value, pointerIndex) {
pointer[pointerIndex] = PickrBase.transform(value, pathParts.slice(pathIndex).join('.'), fn);
});
return false;
}
if (!pointer[attribute]) {
return false;
}
if (lastPathIndex === pathIndex) {
pointer[attribute] = fn(pointer[attribute]);
}
pointer = pointer[attribute];
return true;
});
return context;
},
};

@@ -97,0 +125,0 @@

2

package.json
{
"name": "pickr",
"version": "0.1.0",
"version": "0.1.2",
"description": "Data selector utility",

@@ -5,0 +5,0 @@ "main": "index.js",

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