fast-tree-builder 2.0.0-alpha.2 → 2.0.0-alpha.3
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.
- package/index.d.cts +3 -2
- package/package.json +5 -2
package/index.d.cts
CHANGED
|
@@ -21,7 +21,7 @@ type AccessorReturnType<T, P extends (keyof T) | ((item: T) => any)> = P extends
|
|
|
21
21
|
type IterableKeys<T> = {
|
|
22
22
|
[K in keyof T]: T[K] extends Iterable<unknown> ? K : never;
|
|
23
23
|
}[keyof T];
|
|
24
|
-
|
|
24
|
+
function buildTree<TInputValue extends (TIdAccessor extends (keyof TInputValue) ? object : (TNodeValueKey extends false ? object : unknown)), TIdAccessor extends (keyof TInputValue) | ((item: TInputValue) => unknown), TMappedValue extends (TNodeValueKey extends false ? object : unknown) = TInputValue, TNodeValueKey extends string | number | symbol | false = 'value', TNodeParentKey extends string | number | symbol | false = 'parent', TNodeChildrenKey extends string | number | symbol = 'children', TWithDepth extends boolean = false, TTreeNode = TreeNode<TMappedValue extends undefined ? TInputValue : TMappedValue, TNodeValueKey, TNodeParentKey, TNodeChildrenKey, TWithDepth>>(items: Iterable<TInputValue>, options: {
|
|
25
25
|
/**
|
|
26
26
|
* A string key or function used to get the item's unique identifier.
|
|
27
27
|
*/
|
|
@@ -106,4 +106,5 @@ export default function buildTree<TInputValue extends (TIdAccessor extends (keyo
|
|
|
106
106
|
roots: TTreeNode[];
|
|
107
107
|
nodes: Map<AccessorReturnType<TInputValue, TIdAccessor>, TTreeNode>;
|
|
108
108
|
};
|
|
109
|
-
|
|
109
|
+
declare const _default: { default: typeof buildTree };
|
|
110
|
+
export = _default;
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fast-tree-builder",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.3",
|
|
4
4
|
"description": "Easily construct highly customizable bi-directional tree structures from iterable data.",
|
|
5
5
|
"types": "./index.d.mts",
|
|
6
6
|
"module": "./index.mjs",
|
|
7
7
|
"main": "./index.cjs",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types":
|
|
10
|
+
"types": {
|
|
11
|
+
"import": "./index.d.mts",
|
|
12
|
+
"require": "./index.d.cjs"
|
|
13
|
+
},
|
|
11
14
|
"import": "./index.mjs",
|
|
12
15
|
"require": "./index.cjs"
|
|
13
16
|
}
|