fast-tree-builder 2.0.2 → 2.0.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.
Files changed (2) hide show
  1. package/README.md +5 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![NPM downloads](https://img.shields.io/npm/dm/fast-tree-builder.svg)](https://npmjs.org/package/fast-tree-builder)
5
5
  [![Build Status](https://github.com/lionel87/fast-tree-builder/actions/workflows/build.yaml/badge.svg)](https://github.com/lionel87/fast-tree-builder/actions/workflows/build.yaml)
6
6
  [![Coverage Status](https://coveralls.io/repos/github/lionel87/fast-tree-builder/badge.svg?branch=master)](https://coveralls.io/github/lionel87/fast-tree-builder?branch=master)
7
- ![Maintenance](https://img.shields.io/maintenance/yes/2025)
7
+ ![Maintenance](https://img.shields.io/maintenance/yes/2026)
8
8
 
9
9
  `fast-tree-builder` is a utility for easy tree building from iterable collections, enabling safe and predictable access to hierarchical data. It supports highly customizable input and output shapes.
10
10
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  - You have a list of items,
15
15
  - each item is identifiable by a unique id,
16
- - the items are connected via a *parent id* OR *child ids*.
16
+ - the items are connectable via a *parent id* OR a list of *child ids*.
17
17
 
18
18
 
19
19
  ## Features
@@ -28,7 +28,7 @@
28
28
  - **Multi-Root Support** – Handles disjoint trees naturally.
29
29
  - **Arbitary Node Access** – Returns a `Map` that allows constant-time access to any node.
30
30
  - **Tree Validation** – Detects cycles or nodes reachable through multiple paths.
31
- - **Reference Validation** – Optionally enforce that all parent/child links are valid.
31
+ - **Reference Validation** – Optionally enforce that all parent/child references are resolved.
32
32
  - **Depth Values** – Optionally include a depth value in each node.
33
33
 
34
34
  ## Installation
@@ -119,7 +119,7 @@ Builds a tree structure from an iterable list of items.
119
119
  >
120
120
  > Validation operates differently when in `parentId` mode and in `childIds` mode!
121
121
  > * in `parentId` mode: validates that the parent IDs of root nodes was `null` or `undefined` and nothing else. If you expect these parent IDs to be other than `null` or `undefined`, you can safely turn off this validation and loop trough on the roots manually to check the original parentId values are the ones you expect.
122
- > * in `childIds` mode: validates that every referenced child is resolved. Even if the child list contains `undefined`, a node with an `undefined` as ID must exist in the input.
122
+ > * in `childIds` mode: validates that every referenced child is resolved. Even if the child ids list contains an `undefined` value, a node with an ID of `undefined` must exist in the input.
123
123
 
124
124
 
125
125
  ## Usage
@@ -315,7 +315,7 @@ console.log(roots);
315
315
 
316
316
  If the above doesn't work for your case, define your tree node type from scratch.
317
317
 
318
- We intentionally don’t expose a generic `TreeNode` type in the package, as maintaining a complex set of generic parameters is often more cumbersome than writing a custom recursive type yourself.
318
+ We intentionally avoid providing a generic `TreeNode` type in the package, as maintaining a complex set of generic parameters is often more cumbersome and misleading than writing a custom recursive type yourself.
319
319
 
320
320
  2. How can I present the `children` list in a specific order?
321
321
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fast-tree-builder",
3
- "version": "2.0.2",
3
+ "version": "2.0.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",