@rowanmanning/node-versions 2.0.2 → 2.0.3
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 +1 -1
- package/index.js +4 -4
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare module '@rowanmanning/node-versions' {
|
|
|
13
13
|
): string[];
|
|
14
14
|
|
|
15
15
|
export function getPackageNodeVersions(
|
|
16
|
-
|
|
16
|
+
pkg: Partial<PackageJson> | Partial<AnyPackageLock>,
|
|
17
17
|
options?: Options | undefined
|
|
18
18
|
): string[];
|
|
19
19
|
}
|
package/index.js
CHANGED
|
@@ -32,15 +32,15 @@ exports.getEnginesNodeVersions = function getEnginesNodeVersions(engines, option
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
/** @type {nodeVersions['getPackageNodeVersions']} */
|
|
35
|
-
exports.getPackageNodeVersions = function getPackageNodeVersions(
|
|
35
|
+
exports.getPackageNodeVersions = function getPackageNodeVersions(pkg, options) {
|
|
36
36
|
/** @type {any} */
|
|
37
37
|
let engines;
|
|
38
38
|
|
|
39
39
|
// We can only extract engines data from a v2+ lockfile
|
|
40
|
-
if (typeof
|
|
41
|
-
engines =
|
|
40
|
+
if (typeof pkg?.lockfileVersion === 'number' && pkg.lockfileVersion > 1) {
|
|
41
|
+
engines = pkg?.packages?.['']?.engines?.node;
|
|
42
42
|
} else {
|
|
43
|
-
engines =
|
|
43
|
+
engines = pkg?.engines?.node;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (typeof engines !== 'string') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowanmanning/node-versions",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Get the Node.js versions that a repo says it supports",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Rowan Manning (https://rowanmanning.com/)",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"main": "index.js",
|
|
23
23
|
"types": "index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@rowanmanning/package-json": "^1.0.
|
|
25
|
+
"@rowanmanning/package-json": "^1.0.2",
|
|
26
26
|
"semver": "^7.6.3"
|
|
27
27
|
}
|
|
28
28
|
}
|