snyk-nodejs-lockfile-parser 1.37.1 → 1.37.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/dist/parsers/index.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ interface WorkspacesAlternateConfig {
|
|
|
12
12
|
export declare type ManifestDependencies = {
|
|
13
13
|
[dep: string]: string;
|
|
14
14
|
};
|
|
15
|
+
export declare type PeerDependenciesMeta = {
|
|
16
|
+
[dep: string]: {
|
|
17
|
+
optional: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
15
20
|
export interface ManifestFile {
|
|
16
21
|
name: string;
|
|
17
22
|
private?: string;
|
|
@@ -23,6 +28,7 @@ export interface ManifestFile {
|
|
|
23
28
|
devDependencies?: ManifestDependencies;
|
|
24
29
|
optionalDependencies?: ManifestDependencies;
|
|
25
30
|
peerDependencies?: ManifestDependencies;
|
|
31
|
+
peerDependenciesMeta?: PeerDependenciesMeta;
|
|
26
32
|
resolutions?: ManifestDependencies;
|
|
27
33
|
version?: string;
|
|
28
34
|
}
|
package/dist/parsers/index.js
CHANGED
|
@@ -24,6 +24,7 @@ function parseManifestFile(manifestFileContents) {
|
|
|
24
24
|
}
|
|
25
25
|
exports.parseManifestFile = parseManifestFile;
|
|
26
26
|
function getTopLevelDeps({ targetFile, includeDev, includePeerDeps = false, applyYarn2Resolutions = false, }) {
|
|
27
|
+
var _a, _b;
|
|
27
28
|
let dependencies = [];
|
|
28
29
|
const dependenciesIterator = Object.entries(Object.assign(Object.assign(Object.assign({}, targetFile.dependencies), (includeDev ? targetFile.devDependencies : null)), (targetFile.optionalDependencies || {})));
|
|
29
30
|
for (const [name, version] of dependenciesIterator) {
|
|
@@ -37,6 +38,9 @@ function getTopLevelDeps({ targetFile, includeDev, includePeerDeps = false, appl
|
|
|
37
38
|
}
|
|
38
39
|
if (includePeerDeps && targetFile.peerDependencies) {
|
|
39
40
|
for (const [name, version] of Object.entries(targetFile.peerDependencies)) {
|
|
41
|
+
if ((_b = (_a = targetFile === null || targetFile === void 0 ? void 0 : targetFile.peerDependenciesMeta) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.optional) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
40
44
|
dependencies.push({
|
|
41
45
|
name,
|
|
42
46
|
version,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/parsers/index.ts"],"names":[],"mappings":";;;AAEA,sCAAkD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/parsers/index.ts"],"names":[],"mappings":";;;AAEA,sCAAkD;AAsElD,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,sBAAa,CAAA;IACb,oBAAW,CAAA;AACb,CAAC,EAHW,KAAK,GAAL,aAAK,KAAL,aAAK,QAGhB;AAED,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,2BAAW,CAAA;IACX,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,+BAAe,CAAA;AACjB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AAcD,SAAgB,iBAAiB,CAAC,oBAA4B;IAC5D,IAAI;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;KACzC;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,8BAAqB,CAC7B,yCAAyC,GAAG,CAAC,CAAC,OAAO,CACtD,CAAC;KACH;AACH,CAAC;AARD,8CAQC;AAED,SAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,UAAU,EACV,eAAe,GAAG,KAAK,EACvB,qBAAqB,GAAG,KAAK,GAM9B;;IACC,IAAI,YAAY,GAAU,EAAE,CAAC;IAE7B,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,+CACtC,UAAU,CAAC,YAAY,GACvB,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC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