@thi.ng/zipper 2.1.100 → 2.1.101

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 (3) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +10 -10
  3. package/zipper.js +11 -22
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-04-23T07:02:19Z
3
+ - **Last updated**: 2024-05-08T18:24:32Z
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/zipper",
3
- "version": "2.1.100",
3
+ "version": "2.1.101",
4
4
  "description": "Functional tree editing, manipulation & navigation",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,16 +36,16 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/api": "^8.11.1",
40
- "@thi.ng/arrays": "^2.9.5",
41
- "@thi.ng/checks": "^3.6.3",
42
- "@thi.ng/errors": "^2.5.6"
39
+ "@thi.ng/api": "^8.11.2",
40
+ "@thi.ng/arrays": "^2.9.6",
41
+ "@thi.ng/checks": "^3.6.4",
42
+ "@thi.ng/errors": "^2.5.7"
43
43
  },
44
44
  "devDependencies": {
45
- "@microsoft/api-extractor": "^7.43.0",
46
- "esbuild": "^0.20.2",
47
- "typedoc": "^0.25.12",
48
- "typescript": "^5.4.3"
45
+ "@microsoft/api-extractor": "^7.43.2",
46
+ "esbuild": "^0.21.1",
47
+ "typedoc": "^0.25.13",
48
+ "typescript": "^5.4.5"
49
49
  },
50
50
  "keywords": [
51
51
  "adjacency",
@@ -94,5 +94,5 @@
94
94
  ],
95
95
  "year": 2015
96
96
  },
97
- "gitHead": "5dd66c18a3862a3af69a5b2f49563f7cbdd960c2\n"
97
+ "gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
98
98
  }
package/zipper.js CHANGED
@@ -69,8 +69,7 @@ class Location {
69
69
  get right() {
70
70
  const path = this._path;
71
71
  const rights = path && path.r;
72
- if (!rights)
73
- return;
72
+ if (!rights) return;
74
73
  const r = rights.slice(1);
75
74
  return new Location(
76
75
  rights[0],
@@ -118,11 +117,9 @@ class Location {
118
117
  ) : this;
119
118
  }
120
119
  get down() {
121
- if (!this.isBranch)
122
- return;
120
+ if (!this.isBranch) return;
123
121
  const children = this.children;
124
- if (!children)
125
- return;
122
+ if (!children) return;
126
123
  const path = this._path;
127
124
  const r = children.slice(1);
128
125
  return new Location(
@@ -139,8 +136,7 @@ class Location {
139
136
  get up() {
140
137
  let path = this._path;
141
138
  const pnodes = path && path.nodes;
142
- if (!pnodes)
143
- return;
139
+ if (!pnodes) return;
144
140
  const pnode = peek(pnodes);
145
141
  if (path.changed) {
146
142
  return new Location(
@@ -161,29 +157,23 @@ class Location {
161
157
  }
162
158
  get prev() {
163
159
  let node = this.left;
164
- if (!node)
165
- return this.up;
160
+ if (!node) return this.up;
166
161
  while (true) {
167
162
  const child = node.isBranch ? node.down : void 0;
168
- if (!child)
169
- return node;
163
+ if (!child) return node;
170
164
  node = child.rightmost;
171
165
  }
172
166
  }
173
167
  get next() {
174
- if (this.isBranch)
175
- return this.down;
168
+ if (this.isBranch) return this.down;
176
169
  let right = this.right;
177
- if (right)
178
- return right;
170
+ if (right) return right;
179
171
  let loc = this;
180
172
  while (true) {
181
173
  const up = loc.up;
182
- if (!up)
183
- return;
174
+ if (!up) return;
184
175
  right = up.right;
185
- if (right)
186
- return right;
176
+ if (right) return right;
187
177
  loc = up;
188
178
  }
189
179
  }
@@ -251,8 +241,7 @@ class Location {
251
241
  );
252
242
  while (true) {
253
243
  const child = loc.isBranch ? loc.down : void 0;
254
- if (!child)
255
- return loc;
244
+ if (!child) return loc;
256
245
  loc = child.rightmost;
257
246
  }
258
247
  }