@pnpm/package-is-installable
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -1,2 +0,2 @@ | ||
declare class UnsupportedEngineError extends Error { | ||
export declare class UnsupportedEngineError extends Error { | ||
code: 'ERR_PNPM_UNSUPPORTED_ENGINE'; | ||
@@ -17,2 +17,1 @@ wanted: WantedEngine; | ||
}; | ||
export {}; |
@@ -13,2 +13,3 @@ "use strict"; | ||
} | ||
exports.UnsupportedEngineError = UnsupportedEngineError; | ||
function checkEngine(packageId, wantedEngine, currentEngine) { | ||
@@ -15,0 +16,0 @@ if (!wantedEngine) |
@@ -1,2 +0,2 @@ | ||
declare class UnsupportedPlatformError extends Error { | ||
export declare class UnsupportedPlatformError extends Error { | ||
code: 'ERR_PNPM_UNSUPPORTED_PLATFORM'; | ||
@@ -12,2 +12,1 @@ wanted: Platform; | ||
}; | ||
export {}; |
@@ -11,2 +11,3 @@ "use strict"; | ||
} | ||
exports.UnsupportedPlatformError = UnsupportedPlatformError; | ||
function checkPlatform(packageId, wantedPlatform) { | ||
@@ -13,0 +14,0 @@ const platform = process.platform; |
@@ -0,1 +1,4 @@ | ||
import { UnsupportedEngineError } from './checkEngine'; | ||
import { UnsupportedPlatformError } from './checkPlatform'; | ||
export { UnsupportedEngineError, UnsupportedPlatformError, }; | ||
export default function packageIsInstallable(pkgId: string, pkg: { | ||
@@ -11,3 +14,3 @@ name: string; | ||
}, options: { | ||
engineStrict: boolean; | ||
engineStrict?: boolean; | ||
nodeVersion?: string; | ||
@@ -18,1 +21,12 @@ optional: boolean; | ||
}): boolean | null; | ||
export declare function checkPackage(pkgId: string, manifest: { | ||
engines?: { | ||
node?: string; | ||
npm?: string; | ||
}; | ||
cpu?: string[]; | ||
os?: string[]; | ||
}, options: { | ||
nodeVersion?: string; | ||
pnpmVersion: string; | ||
}): null | UnsupportedEngineError | UnsupportedPlatformError; |
@@ -5,12 +5,7 @@ "use strict"; | ||
const checkEngine_1 = require("./checkEngine"); | ||
exports.UnsupportedEngineError = checkEngine_1.UnsupportedEngineError; | ||
const checkPlatform_1 = require("./checkPlatform"); | ||
exports.UnsupportedPlatformError = checkPlatform_1.UnsupportedPlatformError; | ||
function packageIsInstallable(pkgId, pkg, options) { | ||
const warn = checkPlatform_1.default(pkgId, { | ||
cpu: pkg.cpu || ['any'], | ||
os: pkg.os || ['any'], | ||
}) | ||
|| pkg.engines && checkEngine_1.default(pkgId, pkg.engines, { | ||
node: options.nodeVersion || process.version, | ||
pnpm: options.pnpmVersion, | ||
}); | ||
const warn = checkPackage(pkgId, pkg, options); | ||
if (!warn) | ||
@@ -40,1 +35,12 @@ return true; | ||
exports.default = packageIsInstallable; | ||
function checkPackage(pkgId, manifest, options) { | ||
return checkPlatform_1.default(pkgId, { | ||
cpu: manifest.cpu || ['any'], | ||
os: manifest.os || ['any'], | ||
}) || (manifest.engines && | ||
checkEngine_1.default(pkgId, manifest.engines, { | ||
node: options.nodeVersion || process.version, | ||
pnpm: options.pnpmVersion, | ||
})) || null; | ||
} | ||
exports.checkPackage = checkPackage; |
{ | ||
"name": "@pnpm/package-is-installable", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"author": { | ||
@@ -35,3 +35,3 @@ "name": "Zoltan Kochan", | ||
"@pnpm/types": "3.2.0", | ||
"semver": "6.2.0" | ||
"semver": "6.3.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8721
183
+ Addedsemver@6.3.0(transitive)
- Removedsemver@6.2.0(transitive)
Updatedsemver@6.3.0