hinted-tree-merger 6.2.0 → 6.2.2

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 (2) hide show
  1. package/package.json +10 -9
  2. package/src/versions.mjs +10 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hinted-tree-merger",
3
- "version": "6.2.0",
3
+ "version": "6.2.2",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -28,26 +28,27 @@
28
28
  ],
29
29
  "license": "BSD-2-Clause",
30
30
  "scripts": {
31
- "prepare": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs",
31
+ "prepare": "npm run prepare:typescript",
32
+ "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
32
33
  "test": "npm run test:browser-ava && npm run test:ava",
33
34
  "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
34
35
  "test:browser-ava": "browser-ava --headless --no-keep-open tests/*-ava.mjs tests/*-ava-browser.mjs",
35
36
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
36
37
  "docs": "documentation readme --section=API ./src/**/*.mjs",
37
- "lint": "npm run lint:docs && npm run lint:tsc",
38
+ "lint": "npm run lint:docs && npm run lint:typescript",
38
39
  "lint:docs": "documentation lint ./src/**/*.mjs",
39
- "lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
40
+ "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
40
41
  },
41
42
  "devDependencies": {
42
- "ava": "^6.1.1",
43
- "browser-ava": "^2.2.0",
43
+ "ava": "^6.1.2",
44
+ "browser-ava": "^2.2.8",
44
45
  "c8": "^9.1.0",
45
46
  "documentation": "^14.0.3",
46
- "semantic-release": "^23.0.2",
47
- "typescript": "^5.3.3"
47
+ "semantic-release": "^23.0.8",
48
+ "typescript": "^5.4.5"
48
49
  },
49
50
  "engines": {
50
- "node": ">=20.11.1"
51
+ "node": ">=20.12.1"
51
52
  },
52
53
  "repository": {
53
54
  "type": "git",
package/src/versions.mjs CHANGED
@@ -113,15 +113,15 @@ export function composeVersion(decomposed) {
113
113
  }
114
114
 
115
115
  /**
116
- *
117
- * @param {number[]} a
118
- * @param {number[]} b
116
+ *
117
+ * @param {number[]} a
118
+ * @param {number[]} b
119
119
  * @returns {number}
120
120
  */
121
121
  function cmp(a, b) {
122
122
  for (const i in a) {
123
123
  // @ts-ignore
124
- if (i >= a.length) {
124
+ if (i >= b.length) {
125
125
  break;
126
126
  }
127
127
 
@@ -185,7 +185,12 @@ function toSet(a) {
185
185
  if (isScalar(a)) {
186
186
  return a === undefined ? new Set() : new Set([a]);
187
187
  }
188
- return new Set([...a].map(s => String(s)));
188
+
189
+ if (a[Symbol.iterator]) {
190
+ return new Set([...a].map(s => String(s)));
191
+ }
192
+
193
+ return new Set(Object.values(a));
189
194
  }
190
195
 
191
196
  /**