packtory 0.0.43 → 0.0.45
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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { formatPathLevelMessage, formatSharedDeclarationsMessage } from "./duplicate-messages.js";
|
|
2
|
-
import { intersectAll } from "./set-intersection.js";
|
|
3
2
|
const minimumOwnerCountForDuplicate = 2;
|
|
4
3
|
export function hasMultipleOwners(owners) {
|
|
5
4
|
return owners.length >= minimumOwnerCountForDuplicate;
|
|
@@ -12,12 +11,11 @@ export function duplicateMessage(filePath, owners) {
|
|
|
12
11
|
return formatPathLevelMessage(filePath, owners);
|
|
13
12
|
}
|
|
14
13
|
const [firstOwner, ...remainingOwners] = owners;
|
|
15
|
-
const sharedDeclarations =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
]);
|
|
14
|
+
const sharedDeclarations = remainingOwners.reduce((declarations, owner) => {
|
|
15
|
+
return new Set(Array.from(declarations).filter((declaration) => {
|
|
16
|
+
return owner.survivingBindings.has(declaration);
|
|
17
|
+
}));
|
|
18
|
+
}, new Set(firstOwner.survivingBindings));
|
|
21
19
|
if (sharedDeclarations.size === 0) {
|
|
22
20
|
return undefined;
|
|
23
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate-detection.js","sourceRoot":"","sources":["../../../../../source/checks/rules/duplicate-detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"duplicate-detection.js","sourceRoot":"","sources":["../../../../../source/checks/rules/duplicate-detection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,+BAA+B,EAAE,MAAM,yBAAyB,CAAC;AAKlG,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAExC,MAAM,UAAU,iBAAiB,CAAC,MAA4B;IAC1D,OAAO,MAAM,CAAC,MAAM,IAAI,6BAA6B,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,MAAsB;IACrE,MAAM,uBAAuB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACnD,OAAO,KAAK,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,IAAI,uBAAuB,EAAE,CAAC;QAC1B,OAAO,sBAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IACD,MAAM,CAAC,UAAU,EAAE,GAAG,eAAe,CAAC,GAAG,MAAM,CAAC;IAChD,MAAM,kBAAkB,GAAG,eAAe,CAAC,MAAM,CAAc,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;QACnF,OAAO,IAAI,GAAG,CACV,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;YAC5C,OAAO,KAAK,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACpD,CAAC,CAAC,CACL,CAAC;IACN,CAAC,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC1C,IAAI,kBAAkB,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACrB,CAAC;IACD,OAAO,+BAA+B,CAAC,QAAQ,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;AACjF,CAAC"}
|
package/package.json
CHANGED
|
@@ -57,6 +57,9 @@
|
|
|
57
57
|
"./common/sort-values.js": {
|
|
58
58
|
"import": "./common/sort-values.js"
|
|
59
59
|
},
|
|
60
|
+
"./config/base-validations.js": {
|
|
61
|
+
"import": "./config/base-validations.js"
|
|
62
|
+
},
|
|
60
63
|
"./config/packtory-config-schema.js": {
|
|
61
64
|
"import": "./config/packtory-config-schema.js"
|
|
62
65
|
},
|
|
@@ -116,5 +119,5 @@
|
|
|
116
119
|
"./tar/tarball-builder.js"
|
|
117
120
|
],
|
|
118
121
|
"type": "module",
|
|
119
|
-
"version": "0.0.
|
|
122
|
+
"version": "0.0.45"
|
|
120
123
|
}
|
package/sbom.cdx.json
CHANGED
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
{
|
|
10
10
|
"type": "application",
|
|
11
11
|
"name": "packtory",
|
|
12
|
-
"version": "0.0.
|
|
12
|
+
"version": "0.0.44"
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
16
|
"component": {
|
|
17
17
|
"type": "library",
|
|
18
18
|
"name": "packtory",
|
|
19
|
-
"version": "0.0.
|
|
20
|
-
"bom-ref": "pkg:npm/packtory@0.0.
|
|
21
|
-
"purl": "pkg:npm/packtory@0.0.
|
|
19
|
+
"version": "0.0.45",
|
|
20
|
+
"bom-ref": "pkg:npm/packtory@0.0.45",
|
|
21
|
+
"purl": "pkg:npm/packtory@0.0.45"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"components": [
|
|
@@ -379,7 +379,7 @@
|
|
|
379
379
|
"ref": "pkg:npm/npm-registry-fetch@20.0.1"
|
|
380
380
|
},
|
|
381
381
|
{
|
|
382
|
-
"ref": "pkg:npm/packtory@0.0.
|
|
382
|
+
"ref": "pkg:npm/packtory@0.0.45",
|
|
383
383
|
"dependsOn": [
|
|
384
384
|
"pkg:npm/@arethetypeswrong/core@0.18.4",
|
|
385
385
|
"pkg:npm/@cyclonedx/cyclonedx-library@10.1.0",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
function intersectTwo(left, right) {
|
|
2
|
-
const result = new Set();
|
|
3
|
-
for (const name of left) {
|
|
4
|
-
if (right.has(name)) {
|
|
5
|
-
result.add(name);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return result;
|
|
9
|
-
}
|
|
10
|
-
export function intersectAll(sets) {
|
|
11
|
-
const [first, ...rest] = sets;
|
|
12
|
-
return rest.reduce(intersectTwo, new Set(first));
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=set-intersection.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-intersection.js","sourceRoot":"","sources":["../../../../../source/checks/rules/set-intersection.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,CAAC,IAAyB,EAAE,KAA0B;IACvE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACtB,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAClB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,YAAY,CACxB,IAAyE;IAEzE,MAAM,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,OAAO,IAAI,CAAC,MAAM,CAAc,YAAY,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC"}
|