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

deepdash

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepdash - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

3

deepdash.js

@@ -5,5 +5,6 @@ (function(){

if(!_.eachDeep){
_.eachDeep = function(obj,callback){
function eachDeep(obj,callback){
iterate(obj,"",0,null,"","",callback);
};
_.mixin({ 'eachDeep': eachDeep });
}

@@ -10,0 +11,0 @@ function iterate(obj,path,depth,parent,parentKey,parentPath,callback)

@@ -0,2 +1,6 @@

//inject new method into lodash object
const _ = require('./deepdash')(require('lodash'));
//in browser just load script after lodash
//<script src="lodash.js"></script>
//<script src="deepdash.js"></script>
let obj = {

@@ -50,1 +54,4 @@ a: {

});
// Chaining works too
// _(obj).eachDeep((value, key, path, depth, parent, parentKey, parentPath) => {/* do */}).value();
{
"name": "deepdash",
"version": "1.0.1",
"version": "1.1.0",
"description": "Object tree traversal for lodash",

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

@@ -99,4 +99,10 @@ ## deepdash

```
Chaining works too:
```js
_.eachDeep(obj, (value, key, path, depth, parent, parentKey, parentPath) => {
//do
}).value();
```
### Other traversal methods
Feel free to request other methods implementation like `filterDeep`, `mapDeep` and soon.

@@ -55,2 +55,12 @@ const chai = require('chai'),

});
it('Chaining',()=>{
let c = 0;
_(obj).eachDeep(
(value, key, path, depth, parent, parentKey, parentPath) => {
if (key == 'skip') return false;
c++;
}
).value();
expect(c).equal(25);
});
});

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