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

@pnpm/manifest-utils

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/manifest-utils - npm Package Compare versions

Comparing version 3.0.6 to 3.1.0

5

lib/getPref.d.ts

@@ -6,2 +6,5 @@ export declare type PinnedVersion = 'major' | 'minor' | 'patch' | 'none';

}): string;
export declare function createVersionSpec(version: string | undefined, pinnedVersion?: PinnedVersion): string;
export declare function createVersionSpec(version: string | undefined, opts: {
pinnedVersion?: PinnedVersion;
rolling?: boolean;
}): string;

22

lib/getPref.js

@@ -12,19 +12,23 @@ "use strict";

const prefix = (0, exports.getPrefix)(alias, name);
return `${prefix}${createVersionSpec(version, opts.pinnedVersion)}`;
return `${prefix}${createVersionSpec(version, { pinnedVersion: opts.pinnedVersion })}`;
}
exports.getPref = getPref;
function createVersionSpec(version, pinnedVersion) {
if (!version)
return '*';
switch (pinnedVersion ?? 'major') {
function createVersionSpec(version, opts) {
switch (opts.pinnedVersion ?? 'major') {
case 'none':
return '*';
case 'major':
return `^${version}`;
if (opts.rolling)
return '^';
return !version ? '*' : `^${version}`;
case 'minor':
return `~${version}`;
if (opts.rolling)
return '~';
return !version ? '*' : `~${version}`;
case 'patch':
return `${version}`;
if (opts.rolling)
return '*';
return !version ? '*' : `${version}`;
default:
throw new error_1.default('BAD_PINNED_VERSION', `Cannot pin '${pinnedVersion ?? 'undefined'}'`);
throw new error_1.default('BAD_PINNED_VERSION', `Cannot pin '${opts.pinnedVersion ?? 'undefined'}'`);
}

@@ -31,0 +35,0 @@ }

{
"name": "@pnpm/manifest-utils",
"description": "Utils for dealing with package manifest",
"version": "3.0.6",
"version": "3.1.0",
"bugs": {

@@ -30,3 +30,3 @@ "url": "https://github.com/pnpm/pnpm/issues"

"devDependencies": {
"@pnpm/manifest-utils": "3.0.6"
"@pnpm/manifest-utils": "3.1.0"
},

@@ -33,0 +33,0 @@ "exports": {

Sorry, the diff of this file is not supported yet

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