@thi.ng/zipper 2.1.118 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-12-27T14:11:37Z
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/README.md CHANGED
@@ -180,4 +180,4 @@ If this project contributes to an academic publication, please cite it as:
180
180
 
181
181
  ## License
182
182
 
183
- © 2015 - 2024 Karsten Schmidt // Apache License 2.0
183
+ © 2015 - 2025 Karsten Schmidt // Apache License 2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/zipper",
3
- "version": "2.1.118",
3
+ "version": "2.1.120",
4
4
  "description": "Functional tree editing, manipulation & navigation",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -40,10 +40,10 @@
40
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@thi.ng/api": "^8.11.15",
44
- "@thi.ng/arrays": "^2.10.8",
45
- "@thi.ng/checks": "^3.6.17",
46
- "@thi.ng/errors": "^2.5.21"
43
+ "@thi.ng/api": "^8.11.16",
44
+ "@thi.ng/arrays": "^2.10.10",
45
+ "@thi.ng/checks": "^3.6.19",
46
+ "@thi.ng/errors": "^2.5.22"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@microsoft/api-extractor": "^7.48.1",
@@ -98,5 +98,5 @@
98
98
  ],
99
99
  "year": 2015
100
100
  },
101
- "gitHead": "48bf4c22bf23f88ac99f435106af2214f79a0be1\n"
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 && path.l;
57
- return lefts && lefts.length ? new Location(
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 && path.r;
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 && path.l;
89
- return lefts && lefts.length ? new Location(
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 && path.r;
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 && path.nodes;
138
+ const pnodes = path?.nodes;
139
139
  if (!pnodes) return;
140
140
  const pnode = peek(pnodes);
141
141
  if (path.changed) {