@thi.ng/zipper 2.1.119 → 2.1.120
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/CHANGELOG.md +7 -1
- package/package.json +4 -4
- package/zipper.js +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-01-
|
|
3
|
+
- **Last updated**: 2025-01-14T12:23:33Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [2.1.120](https://github.com/thi-ng/umbrella/tree/@thi.ng/zipper@2.1.120) (2025-01-14)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- use optional chaining & nullish coalescing ([c5a0a13](https://github.com/thi-ng/umbrella/commit/c5a0a13))
|
|
17
|
+
|
|
12
18
|
### [2.1.102](https://github.com/thi-ng/umbrella/tree/@thi.ng/zipper@2.1.102) (2024-06-21)
|
|
13
19
|
|
|
14
20
|
#### ♻️ Refactoring
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/zipper",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.120",
|
|
4
4
|
"description": "Functional tree editing, manipulation & navigation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@thi.ng/api": "^8.11.16",
|
|
44
|
-
"@thi.ng/arrays": "^2.10.
|
|
45
|
-
"@thi.ng/checks": "^3.6.
|
|
44
|
+
"@thi.ng/arrays": "^2.10.10",
|
|
45
|
+
"@thi.ng/checks": "^3.6.19",
|
|
46
46
|
"@thi.ng/errors": "^2.5.22"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
],
|
|
99
99
|
"year": 2015
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "6542b842120bef47cc18d45a1b1db68307a7f04b\n"
|
|
102
102
|
}
|
package/zipper.js
CHANGED
|
@@ -53,8 +53,8 @@ class Location {
|
|
|
53
53
|
}
|
|
54
54
|
get left() {
|
|
55
55
|
const path = this._path;
|
|
56
|
-
const lefts = path
|
|
57
|
-
return lefts
|
|
56
|
+
const lefts = path?.l;
|
|
57
|
+
return lefts?.length ? new Location(
|
|
58
58
|
peek(lefts),
|
|
59
59
|
this._ops,
|
|
60
60
|
__newPath(
|
|
@@ -68,7 +68,7 @@ class Location {
|
|
|
68
68
|
}
|
|
69
69
|
get right() {
|
|
70
70
|
const path = this._path;
|
|
71
|
-
const rights = path
|
|
71
|
+
const rights = path?.r;
|
|
72
72
|
if (!rights) return;
|
|
73
73
|
const r = rights.slice(1);
|
|
74
74
|
return new Location(
|
|
@@ -85,8 +85,8 @@ class Location {
|
|
|
85
85
|
}
|
|
86
86
|
get leftmost() {
|
|
87
87
|
const path = this._path;
|
|
88
|
-
const lefts = path
|
|
89
|
-
return lefts
|
|
88
|
+
const lefts = path?.l;
|
|
89
|
+
return lefts?.length ? new Location(
|
|
90
90
|
lefts[0],
|
|
91
91
|
this._ops,
|
|
92
92
|
__newPath(
|
|
@@ -100,7 +100,7 @@ class Location {
|
|
|
100
100
|
}
|
|
101
101
|
get rightmost() {
|
|
102
102
|
const path = this._path;
|
|
103
|
-
const rights = path
|
|
103
|
+
const rights = path?.r;
|
|
104
104
|
return rights ? new Location(
|
|
105
105
|
peek(rights),
|
|
106
106
|
this._ops,
|
|
@@ -135,7 +135,7 @@ class Location {
|
|
|
135
135
|
}
|
|
136
136
|
get up() {
|
|
137
137
|
let path = this._path;
|
|
138
|
-
const pnodes = path
|
|
138
|
+
const pnodes = path?.nodes;
|
|
139
139
|
if (!pnodes) return;
|
|
140
140
|
const pnode = peek(pnodes);
|
|
141
141
|
if (path.changed) {
|