@bablr/btree 0.3.0 → 0.3.1

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/README.md CHANGED
@@ -1,13 +1,18 @@
1
1
  # @bablr/btree
2
2
 
3
- Functional utilities for working with btrees such as those used in agAST. These trees could also correctly be termed sum trees, and are represented as:
3
+ Functional utilities for working with btrees such as those used in agAST.
4
4
 
5
5
  ```js
6
- let leafNode = [...data];
6
+ expect(push(['a', 'b'], 'c')).toEqual([
7
+ 3,
8
+ [['a'], ['b', 'c']],
9
+ ]);
7
10
 
8
- let branchNode = [sum, [...nodes]];
9
-
10
- let tree = [3, [[node1, node2], [node3]]];
11
+ expect(addAt(0, [3, [['x'], ['y', 'z']]], 'w')).toEqual([
12
+ 4,
13
+ [
14
+ ['w', 'x'],
15
+ ['y', 'z'],
16
+ ],
17
+ ]);
11
18
  ```
12
-
13
- You can differentiate non-leaf nodes because they have a number as their first element. This is possible the data stored in this tree will always be object-typed.
package/lib/index.js CHANGED
@@ -1,7 +1,8 @@
1
- import { buildModule } from './enhanceable.js';
1
+ import { defaultNodeSize, buildModule } from './enhanceable.js';
2
+
3
+ export { defaultNodeSize };
2
4
 
3
5
  export const {
4
- defaultNodeSize,
5
6
  treeFromValues,
6
7
  findBalancePoint,
7
8
  splitValues,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bablr/btree",
3
3
  "description": "Functional utilities for working with btrees such as those used in agAST",
4
- "version": "0.3.0",
4
+ "version": "0.3.1",
5
5
  "author": "Conrad Buck<conartist6@gmail.com>",
6
6
  "type": "module",
7
7
  "files": [