@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 +12 -7
- package/lib/index.js +3 -2
- package/package.json +1 -1
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.
|
|
3
|
+
Functional utilities for working with btrees such as those used in agAST.
|
|
4
4
|
|
|
5
5
|
```js
|
|
6
|
-
|
|
6
|
+
expect(push(['a', 'b'], 'c')).toEqual([
|
|
7
|
+
3,
|
|
8
|
+
[['a'], ['b', 'c']],
|
|
9
|
+
]);
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
package/package.json
CHANGED