sculp-js 1.19.6 → 1.19.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/array.cjs +1 -1
  3. package/dist/cjs/async.cjs +1 -1
  4. package/dist/cjs/base64.cjs +1 -1
  5. package/dist/cjs/clipboard.cjs +1 -1
  6. package/dist/cjs/cloneDeep.cjs +1 -1
  7. package/dist/cjs/cookie.cjs +1 -1
  8. package/dist/cjs/date.cjs +1 -1
  9. package/dist/cjs/dom.cjs +1 -1
  10. package/dist/cjs/download.cjs +1 -1
  11. package/dist/cjs/file.cjs +1 -1
  12. package/dist/cjs/func.cjs +1 -1
  13. package/dist/cjs/index.cjs +3 -2
  14. package/dist/cjs/isEqual.cjs +1 -1
  15. package/dist/cjs/math.cjs +1 -1
  16. package/dist/cjs/number.cjs +1 -1
  17. package/dist/cjs/object.cjs +1 -1
  18. package/dist/cjs/path.cjs +1 -1
  19. package/dist/cjs/qs.cjs +1 -1
  20. package/dist/cjs/random.cjs +1 -1
  21. package/dist/cjs/string.cjs +1 -1
  22. package/dist/cjs/tooltip.cjs +1 -1
  23. package/dist/cjs/tree.cjs +53 -46
  24. package/dist/cjs/type.cjs +1 -1
  25. package/dist/cjs/unicodeToolkit.cjs +1 -1
  26. package/dist/cjs/unique.cjs +1 -1
  27. package/dist/cjs/url.cjs +1 -1
  28. package/dist/cjs/validator.cjs +1 -1
  29. package/dist/cjs/variable.cjs +1 -1
  30. package/dist/cjs/watermark.cjs +1 -1
  31. package/dist/esm/array.mjs +1 -1
  32. package/dist/esm/async.mjs +1 -1
  33. package/dist/esm/base64.mjs +1 -1
  34. package/dist/esm/clipboard.mjs +1 -1
  35. package/dist/esm/cloneDeep.mjs +1 -1
  36. package/dist/esm/cookie.mjs +1 -1
  37. package/dist/esm/date.mjs +1 -1
  38. package/dist/esm/dom.mjs +1 -1
  39. package/dist/esm/download.mjs +1 -1
  40. package/dist/esm/file.mjs +1 -1
  41. package/dist/esm/func.mjs +1 -1
  42. package/dist/esm/index.mjs +3 -2
  43. package/dist/esm/isEqual.mjs +1 -1
  44. package/dist/esm/math.mjs +1 -1
  45. package/dist/esm/number.mjs +1 -1
  46. package/dist/esm/object.mjs +1 -1
  47. package/dist/esm/path.mjs +1 -1
  48. package/dist/esm/qs.mjs +1 -1
  49. package/dist/esm/random.mjs +1 -1
  50. package/dist/esm/string.mjs +1 -1
  51. package/dist/esm/tooltip.mjs +1 -1
  52. package/dist/esm/tree.mjs +53 -46
  53. package/dist/esm/type.mjs +1 -1
  54. package/dist/esm/unicodeToolkit.mjs +1 -1
  55. package/dist/esm/unique.mjs +1 -1
  56. package/dist/esm/url.mjs +1 -1
  57. package/dist/esm/validator.mjs +1 -1
  58. package/dist/esm/variable.mjs +1 -1
  59. package/dist/esm/watermark.mjs +1 -1
  60. package/dist/types/tree.d.ts +54 -48
  61. package/dist/umd/index.min.js +2 -2
  62. package/package.json +8 -5
  63. /package/{LICENSE.md → LICENSE} +0 -0
package/dist/esm/tree.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -20,10 +20,11 @@ function getChildNodes(item, childField, isDomNode) {
20
20
  return isDomNode && isNodeList(child) ? Array.from(child) : Array.isArray(child) ? child : null;
21
21
  }
22
22
  /**
23
- * 深度遍历函数 (支持 continue break 操作), 可用于遍历 Array NodeList 类型的数据
24
- * @param {ArrayLike<V>} tree 树形数据
25
- * @param {Function} iterator 迭代函数,返回值为 true continue, 返回值为 false 时 break
26
- * @param {options} options 支持定制子元素名称、反向遍历、广度优先遍历,默认{
23
+ * Tree traversal function (default DFS, supports continue and break operations).
24
+ * Can be used to traverse Array and NodeList type data.
25
+ * @param {V[]} tree - Tree data
26
+ * @param {Function} iterator - Iterator function. Returns true to continue, false to break.
27
+ * @param {object} options - Options to customize child element name, reverse traversal, breadth-first traversal. Default: {
27
28
  childField: 'children',
28
29
  reverse: false,
29
30
  breadthFirst: false,
@@ -98,10 +99,10 @@ function forEachDeep(
98
99
  tree = null;
99
100
  }
100
101
  /**
101
- * 树查找函数,可用于查找 Array NodeList 类型的数据
102
- * @param {ArrayLike<V>} tree 树形数据
103
- * @param {Function} predicate 断言函数
104
- * @param {options} options 支持定制子元素名称、反向遍历、广度优先遍历,默认{
102
+ * Tree search function, can be used to search Array and NodeList type data.
103
+ * @param {V[]} tree - Tree data
104
+ * @param {Function} predicate - Predicate function
105
+ * @param {object} options - Options to customize child element name, reverse traversal, breadth-first traversal. Default: {
105
106
  childField: 'children',
106
107
  reverse: false,
107
108
  breadthFirst: false,
@@ -133,10 +134,10 @@ function findDeep(
133
134
  return result;
134
135
  }
135
136
  /**
136
- * 树过滤函数,可用于过滤 Array NodeList 类型的数据
137
- * @param {ArrayLike<V>} tree 树形数据
138
- * @param {Function} predicate 断言函数
139
- * @param {options} options 支持定制子元素名称、反向遍历、广度优先遍历,默认{
137
+ * Tree filter function, can be used to filter Array and NodeList type data.
138
+ * @param {V[]} tree - Tree data
139
+ * @param {Function} predicate - Predicate function
140
+ * @param {object} options - Options to customize child element name, reverse traversal, breadth-first traversal. Default: {
140
141
  childField: 'children',
141
142
  reverse: false,
142
143
  breadthFirst: false,
@@ -167,16 +168,17 @@ function filterDeep(
167
168
  return result;
168
169
  }
169
170
  /**
170
- * 创建一个新数组,深度优先遍历的 Map 函数 (支持 continue break 操作), 可用于 insert tree item remove tree item
171
+ * Creates a new array using a depth-first traversal Map function (supports continue and break operations).
172
+ * Can be used for inserting or removing tree items.
171
173
  *
172
- * 可遍历任何带有 length 属性和数字键的类数组对象
173
- * @param {ArrayLike<V>} tree 树形数据
174
- * @param {Function} iterator 迭代函数,返回值为 true continue, 返回值为 false break
175
- * @param {options} options 支持定制子元素名称、反向遍历,默认{
174
+ * Can traverse any array-like object with a length property and numeric keys.
175
+ * @param {V[]} tree - Tree data
176
+ * @param {Function} iterator - Iterator function. Returns true to continue, false to break.
177
+ * @param {object} options - Options to customize child element name, reverse traversal. Default: {
176
178
  childField: 'children',
177
179
  reverse: false,
178
180
  }
179
- * @returns {any[]} 新的一棵树
181
+ * @returns {any[]} A new tree structure
180
182
  */
181
183
  function mapDeep(
182
184
  tree,
@@ -234,14 +236,14 @@ function mapDeep(
234
236
  return newTree;
235
237
  }
236
238
  /**
237
- * 在树中找到 id 为某个值的节点,并返回上游的所有父级节点
239
+ * Retrieves the path (ancestors + self) for a given node ID.
238
240
  *
239
- * @param {ArrayLike<T>} tree - 树形数据
240
- * @param {number | string} nodeId - 目标元素 ID
241
- * @param {ITreeConf} options - 迭代配置项,默认:{ children = 'children', id = 'id' }
242
- * @returns {[(number | string)[], V[]]} - parentId...childId, parentObject-childObject 组成的二维数组
241
+ * @param {ArrayLike<T>} tree - Tree data
242
+ * @param {number | string} nodeId - Target node ID
243
+ * @param {ITreeConf} options - Configuration. Default: { childField = 'children', keyField = 'id' }
244
+ * @returns {[(number | string)[], V[]]} - Array of IDs and Array of Nodes from root to target
243
245
  */
244
- function searchTreeById(tree, nodeId, options = { childField: 'children', keyField: 'id' }) {
246
+ function getPathById(tree, nodeId, options = { childField: 'children', keyField: 'id' }) {
245
247
  const { childField = 'children', keyField = 'id' } = isObject(options) ? options : {};
246
248
  const flatMap = {};
247
249
  // 扁平化 - 使用迭代而非递归,避免栈溢出
@@ -279,11 +281,11 @@ function searchTreeById(tree, nodeId, options = { childField: 'children', keyFie
279
281
  return [ids, nodes];
280
282
  }
281
283
  /**
282
- * 扁平化数组转换成树
283
- * @param {any[]} list
284
- * @param {IFieldOptions} options 定制 id 字段名,子元素字段名,父元素字段名,默认
284
+ * Converts a flat array into a tree structure.
285
+ * @param {any[]} list - Flat list of items
286
+ * @param {IFieldOptions} options - Customizes id field name, child element field name, parent element field name. Default:
285
287
  * { keyField: 'key', childField: 'children', pidField: 'pid' }
286
- * @returns {any[]}
288
+ * @returns {any[]} Tree structure array
287
289
  */
288
290
  function formatTree(list, options = defaultFieldOptions) {
289
291
  const { keyField = 'key', childField = 'children', pidField = 'pid' } = isObject(options) ? options : {};
@@ -309,11 +311,11 @@ function formatTree(list, options = defaultFieldOptions) {
309
311
  return treeArr;
310
312
  }
311
313
  /**
312
- * 树形结构转扁平化
313
- * @param {any[]} treeList
314
- * @param {IFieldOptions} options 定制 id 字段名,子元素字段名,父元素字段名,默认
314
+ * Converts a tree structure into a flat array.
315
+ * @param {any[]} treeList - Tree structure array
316
+ * @param {IFieldOptions} options - Customizes id field name, child element field name, parent element field name. Default:
315
317
  * { keyField: 'key', childField: 'children', pidField: 'pid' }
316
- * @returns {any[]}
318
+ * @returns {any[]} Flat array
317
319
  */
318
320
  function flatTree(treeList, options = defaultFieldOptions) {
319
321
  const { keyField = 'key', childField = 'children', pidField = 'pid' } = isObject(options) ? options : {};
@@ -340,23 +342,26 @@ function flatTree(treeList, options = defaultFieldOptions) {
340
342
  return res;
341
343
  }
342
344
  /**
343
- * 模糊搜索函数,返回包含搜索字符的节点及其祖先节点, 适用于树型组件的字符过滤功能
344
- * 以下搜索条件二选一,按先后优先级处理:
345
- * 1. 过滤函数filter, 返回true/false
346
- * 2. 匹配关键词,支持是否启用忽略大小写来判断
345
+ * Fuzzy search function that returns nodes containing the search character and their ancestor nodes.
346
+ * Suitable for character filtering in tree components.
347
347
  *
348
- * 有以下特性:
349
- * 1. 可配置removeEmptyChild字段,来决定是否移除搜索结果中的空children字段
350
- * 2. 若无任何过滤条件或keyword模式匹配且keyword为空串,返回原对象;其他情况返回新数组
351
- * @param {V[]} nodes
352
- * @param {IFilterCondition} filterCondition
353
- * @param {ISearchTreeOpts} options 默认配置项 {
348
+ * Two search conditions are available, processed in priority order:
349
+ * 1. Filter function `filter`, returning true/false.
350
+ * 2. Keyword matching, supporting case-insensitive check.
351
+ *
352
+ * Features:
353
+ * 1. Configurable `removeEmptyChild` field to decide whether to remove empty children fields in search results.
354
+ * 2. If no filter condition is provided, or keyword mode is used with an empty keyword, the original object is returned; otherwise, a new array is returned.
355
+ *
356
+ * @param {V[]} nodes - Tree nodes
357
+ * @param {IFilterCondition} filterCondition - Filter conditions
358
+ * @param {ISearchTreeOpts} options - Default configuration: {
354
359
  childField: 'children',
355
360
  nameField: 'name',
356
361
  removeEmptyChild: false,
357
362
  ignoreCase: true
358
363
  }
359
- * @returns {V[]}
364
+ * @returns {V[]} Filtered tree nodes
360
365
  */
361
366
  function fuzzySearchTree(nodes, filterCondition, options = defaultSearchTreeOptions) {
362
367
  if (!objectHas(filterCondition, 'filter') && !filterCondition.keyword) {
@@ -411,7 +416,8 @@ var tree = {
411
416
  findDeep,
412
417
  filterDeep,
413
418
  mapDeep,
414
- searchTreeById,
419
+ getPathById,
420
+ searchTreeById: getPathById,
415
421
  formatTree,
416
422
  flatTree,
417
423
  fuzzySearchTree
@@ -425,6 +431,7 @@ export {
425
431
  forEachDeep,
426
432
  formatTree,
427
433
  fuzzySearchTree,
434
+ getPathById,
428
435
  mapDeep,
429
- searchTreeById
436
+ getPathById as searchTreeById
430
437
  };
package/dist/esm/type.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/url.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.19.6
2
+ * sculp-js v1.19.12
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -14,10 +14,11 @@ export interface IFilterCondition<V> {
14
14
  filter?: (args: V) => boolean;
15
15
  }
16
16
  /**
17
- * 深度遍历函数 (支持 continue break 操作), 可用于遍历 Array NodeList 类型的数据
18
- * @param {ArrayLike<V>} tree 树形数据
19
- * @param {Function} iterator 迭代函数,返回值为 true continue, 返回值为 false 时 break
20
- * @param {options} options 支持定制子元素名称、反向遍历、广度优先遍历,默认{
17
+ * Tree traversal function (default DFS, supports continue and break operations).
18
+ * Can be used to traverse Array and NodeList type data.
19
+ * @param {V[]} tree - Tree data
20
+ * @param {Function} iterator - Iterator function. Returns true to continue, false to break.
21
+ * @param {object} options - Options to customize child element name, reverse traversal, breadth-first traversal. Default: {
21
22
  childField: 'children',
22
23
  reverse: false,
23
24
  breadthFirst: false,
@@ -25,17 +26,17 @@ export interface IFilterCondition<V> {
25
26
  }
26
27
  * @returns {*}
27
28
  */
28
- export declare function forEachDeep<V>(tree: ArrayLike<V>, iterator: (val: V, index: number, currentArr: ArrayLike<V>, tree: ArrayLike<V>, parent: V | null, level: number) => boolean | void, options?: {
29
+ export declare function forEachDeep<V>(tree: V[], iterator: (val: V, index: number, currentArr: V[], tree: V[], parent: V | null, level: number) => boolean | void, options?: {
29
30
  childField?: string;
30
31
  reverse?: boolean;
31
32
  breadthFirst?: boolean;
32
33
  isDomNode?: boolean;
33
34
  }): void;
34
35
  /**
35
- * 树查找函数,可用于查找 Array NodeList 类型的数据
36
- * @param {ArrayLike<V>} tree 树形数据
37
- * @param {Function} predicate 断言函数
38
- * @param {options} options 支持定制子元素名称、反向遍历、广度优先遍历,默认{
36
+ * Tree search function, can be used to search Array and NodeList type data.
37
+ * @param {V[]} tree - Tree data
38
+ * @param {Function} predicate - Predicate function
39
+ * @param {object} options - Options to customize child element name, reverse traversal, breadth-first traversal. Default: {
39
40
  childField: 'children',
40
41
  reverse: false,
41
42
  breadthFirst: false,
@@ -43,17 +44,17 @@ export declare function forEachDeep<V>(tree: ArrayLike<V>, iterator: (val: V, in
43
44
  }
44
45
  * @returns {V|null}
45
46
  */
46
- export declare function findDeep<V>(tree: ArrayLike<V>, predicate: (val: V, index: number, currentArr: ArrayLike<V>, tree: ArrayLike<V>, parent: V | null, level: number) => boolean | void, options?: {
47
+ export declare function findDeep<V>(tree: V[], predicate: (val: V, index: number, currentArr: V[], tree: V[], parent: V | null, level: number) => boolean | void, options?: {
47
48
  childField?: string;
48
49
  reverse?: boolean;
49
50
  breadthFirst?: boolean;
50
51
  isDomNode?: boolean;
51
52
  }): V | null;
52
53
  /**
53
- * 树过滤函数,可用于过滤 Array NodeList 类型的数据
54
- * @param {ArrayLike<V>} tree 树形数据
55
- * @param {Function} predicate 断言函数
56
- * @param {options} options 支持定制子元素名称、反向遍历、广度优先遍历,默认{
54
+ * Tree filter function, can be used to filter Array and NodeList type data.
55
+ * @param {V[]} tree - Tree data
56
+ * @param {Function} predicate - Predicate function
57
+ * @param {object} options - Options to customize child element name, reverse traversal, breadth-first traversal. Default: {
57
58
  childField: 'children',
58
59
  reverse: false,
59
60
  breadthFirst: false,
@@ -61,76 +62,80 @@ export declare function findDeep<V>(tree: ArrayLike<V>, predicate: (val: V, inde
61
62
  }
62
63
  * @returns {V[]}
63
64
  */
64
- export declare function filterDeep<V>(tree: ArrayLike<V>, predicate: (val: V, index: number, currentArr: ArrayLike<V>, tree: ArrayLike<V>, parent: V | null, level: number) => boolean | void, options?: {
65
+ export declare function filterDeep<V>(tree: V[], predicate: (val: V, index: number, currentArr: V[], tree: V[], parent: V | null, level: number) => boolean | void, options?: {
65
66
  childField?: string;
66
67
  reverse?: boolean;
67
68
  breadthFirst?: boolean;
68
69
  isDomNode?: boolean;
69
70
  }): V[];
70
71
  /**
71
- * 创建一个新数组,深度优先遍历的 Map 函数 (支持 continue break 操作), 可用于 insert tree item remove tree item
72
+ * Creates a new array using a depth-first traversal Map function (supports continue and break operations).
73
+ * Can be used for inserting or removing tree items.
72
74
  *
73
- * 可遍历任何带有 length 属性和数字键的类数组对象
74
- * @param {ArrayLike<V>} tree 树形数据
75
- * @param {Function} iterator 迭代函数,返回值为 true continue, 返回值为 false break
76
- * @param {options} options 支持定制子元素名称、反向遍历,默认{
75
+ * Can traverse any array-like object with a length property and numeric keys.
76
+ * @param {V[]} tree - Tree data
77
+ * @param {Function} iterator - Iterator function. Returns true to continue, false to break.
78
+ * @param {object} options - Options to customize child element name, reverse traversal. Default: {
77
79
  childField: 'children',
78
80
  reverse: false,
79
81
  }
80
- * @returns {any[]} 新的一棵树
82
+ * @returns {any[]} A new tree structure
81
83
  */
82
84
  export declare function mapDeep<T>(tree: T[], iterator: (val: T, index: number, currentArr: T[], tree: T[], parent: T | null, level: number) => {
83
85
  [k: string | number]: any;
84
86
  } | boolean, options?: {
85
87
  childField?: string;
86
88
  reverse?: boolean;
87
- breadthFirst?: boolean;
88
89
  }): any[];
89
90
  export type IdLike = number | string;
90
91
  export type ITreeConf = Omit<IFieldOptions, 'pidField'>;
91
92
  /**
92
- * 在树中找到 id 为某个值的节点,并返回上游的所有父级节点
93
+ * Retrieves the path (ancestors + self) for a given node ID.
93
94
  *
94
- * @param {ArrayLike<T>} tree - 树形数据
95
- * @param {number | string} nodeId - 目标元素 ID
96
- * @param {ITreeConf} options - 迭代配置项,默认:{ children = 'children', id = 'id' }
97
- * @returns {[(number | string)[], V[]]} - parentId...childId, parentObject-childObject 组成的二维数组
95
+ * @param {ArrayLike<T>} tree - Tree data
96
+ * @param {number | string} nodeId - Target node ID
97
+ * @param {ITreeConf} options - Configuration. Default: { childField = 'children', keyField = 'id' }
98
+ * @returns {[(number | string)[], V[]]} - Array of IDs and Array of Nodes from root to target
98
99
  */
99
- export declare function searchTreeById<V>(tree: ArrayLike<V>, nodeId: IdLike, options?: ITreeConf): [(number | string)[], any[]];
100
+ export declare function getPathById<V>(tree: V[], nodeId: IdLike, options?: ITreeConf): [(number | string)[], any[]];
101
+ export { getPathById as searchTreeById };
100
102
  /**
101
- * 扁平化数组转换成树
102
- * @param {any[]} list
103
- * @param {IFieldOptions} options 定制 id 字段名,子元素字段名,父元素字段名,默认
103
+ * Converts a flat array into a tree structure.
104
+ * @param {any[]} list - Flat list of items
105
+ * @param {IFieldOptions} options - Customizes id field name, child element field name, parent element field name. Default:
104
106
  * { keyField: 'key', childField: 'children', pidField: 'pid' }
105
- * @returns {any[]}
107
+ * @returns {any[]} Tree structure array
106
108
  */
107
109
  export declare function formatTree(list: any[], options?: IFieldOptions): any[];
108
110
  /**
109
- * 树形结构转扁平化
110
- * @param {any[]} treeList
111
- * @param {IFieldOptions} options 定制 id 字段名,子元素字段名,父元素字段名,默认
111
+ * Converts a tree structure into a flat array.
112
+ * @param {any[]} treeList - Tree structure array
113
+ * @param {IFieldOptions} options - Customizes id field name, child element field name, parent element field name. Default:
112
114
  * { keyField: 'key', childField: 'children', pidField: 'pid' }
113
- * @returns {any[]}
115
+ * @returns {any[]} Flat array
114
116
  */
115
117
  export declare function flatTree(treeList: any[], options?: IFieldOptions): any[];
116
118
  /**
117
- * 模糊搜索函数,返回包含搜索字符的节点及其祖先节点, 适用于树型组件的字符过滤功能
118
- * 以下搜索条件二选一,按先后优先级处理:
119
- * 1. 过滤函数filter, 返回true/false
120
- * 2. 匹配关键词,支持是否启用忽略大小写来判断
119
+ * Fuzzy search function that returns nodes containing the search character and their ancestor nodes.
120
+ * Suitable for character filtering in tree components.
121
+ *
122
+ * Two search conditions are available, processed in priority order:
123
+ * 1. Filter function `filter`, returning true/false.
124
+ * 2. Keyword matching, supporting case-insensitive check.
121
125
  *
122
- * 有以下特性:
123
- * 1. 可配置removeEmptyChild字段,来决定是否移除搜索结果中的空children字段
124
- * 2. 若无任何过滤条件或keyword模式匹配且keyword为空串,返回原对象;其他情况返回新数组
125
- * @param {V[]} nodes
126
- * @param {IFilterCondition} filterCondition
127
- * @param {ISearchTreeOpts} options 默认配置项 {
126
+ * Features:
127
+ * 1. Configurable `removeEmptyChild` field to decide whether to remove empty children fields in search results.
128
+ * 2. If no filter condition is provided, or keyword mode is used with an empty keyword, the original object is returned; otherwise, a new array is returned.
129
+ *
130
+ * @param {V[]} nodes - Tree nodes
131
+ * @param {IFilterCondition} filterCondition - Filter conditions
132
+ * @param {ISearchTreeOpts} options - Default configuration: {
128
133
  childField: 'children',
129
134
  nameField: 'name',
130
135
  removeEmptyChild: false,
131
136
  ignoreCase: true
132
137
  }
133
- * @returns {V[]}
138
+ * @returns {V[]} Filtered tree nodes
134
139
  */
135
140
  export declare function fuzzySearchTree<V>(nodes: V[], filterCondition: IFilterCondition<V>, options?: ISearchTreeOpts): V[];
136
141
  declare const _default: {
@@ -138,7 +143,8 @@ declare const _default: {
138
143
  findDeep: typeof findDeep;
139
144
  filterDeep: typeof filterDeep;
140
145
  mapDeep: typeof mapDeep;
141
- searchTreeById: typeof searchTreeById;
146
+ getPathById: typeof getPathById;
147
+ searchTreeById: typeof getPathById;
142
148
  formatTree: typeof formatTree;
143
149
  flatTree: typeof flatTree;
144
150
  fuzzySearchTree: typeof fuzzySearchTree;