ether-admin/node_modules/array-tree-filter
chiguyong eb399474f4 init: ether-admin frontend project
- Vue3 + TypeScript + Ant Design Vue
- Auth, User, Role, Project management pages
- Pinia state management
- Vue Router with auth guard
2026-03-19 09:28:30 +08:00
..
lib init: ether-admin frontend project 2026-03-19 09:28:30 +08:00
README.md init: ether-admin frontend project 2026-03-19 09:28:30 +08:00
index.d.ts init: ether-admin frontend project 2026-03-19 09:28:30 +08:00
package.json init: ether-admin frontend project 2026-03-19 09:28:30 +08:00

README.md

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: [...] }
// ]