array-tree-filter

WebJar for array-tree-filter

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

array-tree-filter
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

array-tree-filter
WebJar for array-tree-filter
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/afc163/array-tree-filter

Download array-tree-filter

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/array-tree-filter/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>array-tree-filter</artifactId>
    <version>2.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/array-tree-filter/
implementation 'org.webjars.npm:array-tree-filter:2.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/array-tree-filter/
implementation ("org.webjars.npm:array-tree-filter:2.1.0")
'org.webjars.npm:array-tree-filter:jar:2.1.0'
<dependency org="org.webjars.npm" name="array-tree-filter" rev="2.1.0">
  <artifact name="array-tree-filter" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='array-tree-filter', version='2.1.0')
)
libraryDependencies += "org.webjars.npm" % "array-tree-filter" % "2.1.0"
[org.webjars.npm/array-tree-filter "2.1.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

array-tree-filter

Filter by keys in array tree.

NPM version Build Status David Status NPM downloads

import arrayTreeFilter from 'array-tree-filter';

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

console.log(result);
// [
//   { value: 'a', children: [...] },
//   { value: 'b', children: [...] },
//   { value: 'c', children: [...] }
// ]

Versions

Version
2.1.0
1.0.1
1.0.0