Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

array-tree-filter

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 2.0.0

lib/index.js

12

package.json
{
"name": "array-tree-filter",
"version": "1.0.1",
"version": "2.0.0",
"description": "filter in array tree",
"main": "index.js",
"main": "lib/index.js",
"scripts": {
"test": "tape test/*.js"
"test": "npm run build && tape test/*.js",
"pub": "npm run build && npm publish",
"build": "rollup index.js --output.format umd --name 'arrayTreeFilter' --output.file lib/index.js"
},
"files": [
"lib"
],
"repository": {

@@ -25,4 +30,5 @@ "type": "git",

"devDependencies": {
"rollup": "^0.52.1",
"tape": "^4.3.0"
}
}
# array-tree-filter
filter in array tree.
Filter by keys in array tree.

@@ -11,5 +11,5 @@ [![NPM version](https://img.shields.io/npm/v/array-tree-filter.svg?style=flat)](https://npmjs.org/package/array-tree-filter)

```js
var arrayTreeFilter = require('array-tree-filter');
import arrayTreeFilter from 'array-tree-filter';
var data = [{
const data = [{
value: 'a',

@@ -21,13 +21,11 @@ children: [{

}, {
value: 'd'
value: 'd',
}]
}]
}],
}];
const values = ['a', 'b', 'c'];
const result = arrayTreeFilter(
data, (item, level) => item.value === values[level]
);
var values = ['a', 'b', 'c'];
var result = arrayTreeFilter(data, function(item, level) {
return item.value === values[level];
});
console.log(result);

@@ -34,0 +32,0 @@ // [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc