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.6.2 to 1.6.3

2

package.json
{
"name": "deepdash",
"version": "1.6.2",
"version": "1.6.3",
"description": "Object tree traversal for lodash",

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

@@ -148,2 +148,106 @@ 'use strict';

});
//https://stackoverflow.com/questions/48270845/deep-filtering-array-of-objects-javascript
it('deep-filtering-array-of-objects-javascript', function() {
var types = [
{
name: 'Dresses',
checked: true,
collections: [
{
name: 'My Collection',
checked: true,
variations: [
{
size: 'XXS',
checked: true,
},
{
size: 'XS',
checked: false,
},
],
},
{
name: 'False Collection',
checked: false,
variations: [
{
size: 'XXS',
checked: false,
},
{
size: 'XS',
checked: false,
},
],
},
],
},
{
name: 'Tops',
checked: true,
collections: [
{
name: 'Another Collection',
checked: true,
variations: [
{
size: 'XXS',
checked: false,
},
{
size: 'XS',
checked: true,
},
],
},
],
},
];
var filtrate = _.filterDeep(types, function(
value,
key,
path,
depth,
parent
) {
if (parent.checked) return true;
});
expect(filtrate).to.deep.equal([
{
name: 'Dresses',
checked: true,
collections: [
{
name: 'My Collection',
checked: true,
variations: [
{
size: 'XXS',
checked: true,
},
],
},
],
},
{
name: 'Tops',
checked: true,
collections: [
{
name: 'Another Collection',
checked: true,
variations: [
{
size: 'XS',
checked: true,
},
],
},
],
},
]);
});
});
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