hinted-tree-merger 6.1.1 → 6.2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/versions.mjs +9 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hinted-tree-merger",
3
- "version": "6.1.1",
3
+ "version": "6.2.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
package/src/versions.mjs CHANGED
@@ -113,9 +113,9 @@ 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) {
@@ -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
  /**