Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/package-is-installable

Package Overview
Dependencies
Maintainers
3
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/package-is-installable - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

3

lib/checkEngine.d.ts

@@ -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": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc