@slimlib/refine-partition 2.0.1 → 2.0.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.
package/index.d.ts.map
ADDED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @template T
|
|
3
|
-
* @returns {(newPartitionCandidate?: Iterable<T>) => Iterable<Iterable<T>>}
|
|
4
|
-
*/
|
|
5
1
|
export default function () {
|
|
6
|
-
|
|
2
|
+
|
|
7
3
|
const processed = new Set();
|
|
8
4
|
|
|
9
5
|
return newPartitionCandidate => {
|
|
@@ -13,26 +9,24 @@ export default function () {
|
|
|
13
9
|
for (const partitionItem of [...processed]) {
|
|
14
10
|
const intersection = partitionItem.intersection(remainingElements);
|
|
15
11
|
if (intersection.size > 0) {
|
|
16
|
-
|
|
12
|
+
|
|
17
13
|
remainingElements = remainingElements.difference(intersection);
|
|
18
|
-
|
|
14
|
+
|
|
19
15
|
if (intersection.size < partitionItem.size) {
|
|
20
|
-
|
|
16
|
+
|
|
21
17
|
processed.delete(partitionItem);
|
|
22
18
|
const remainder = partitionItem.difference(intersection);
|
|
23
19
|
processed.add(remainder);
|
|
24
20
|
processed.add(intersection);
|
|
25
21
|
}
|
|
26
|
-
|
|
27
|
-
// No need to delete/add since partitionItem already contains all intersection elements
|
|
22
|
+
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
// Add elements that didn't intersect with any existing partition
|
|
32
26
|
if (remainingElements.size > 0) {
|
|
33
27
|
processed.add(remainingElements);
|
|
34
28
|
}
|
|
35
29
|
}
|
|
36
|
-
return
|
|
30
|
+
return (processed);
|
|
37
31
|
};
|
|
38
32
|
}
|
package/package.json
CHANGED
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"name": "@slimlib/refine-partition",
|
|
5
5
|
"description": "Simple refine partition implementation",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Konstantin Shutkin",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./
|
|
11
|
-
"default": "./
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"default": "./index.js"
|
|
12
12
|
},
|
|
13
13
|
"./package.json": "./package.json"
|
|
14
14
|
},
|
|
15
|
-
"types": "./
|
|
16
|
-
"files": [
|
|
17
|
-
"src",
|
|
18
|
-
"types"
|
|
19
|
-
],
|
|
15
|
+
"types": "./index.d.ts",
|
|
20
16
|
"engines": {
|
|
21
17
|
"node": ">=22"
|
|
22
18
|
},
|
package/types/index.d.ts.map
DELETED
|
File without changes
|