Files
pnpm/packages/plugin-commands-installation/src/getPinnedVersion.ts
amit 9d2ff0309b fix: pnpm doesn't respect save-prefix (#3420)
When save-prefix in .npmrc is set to an empty string,
 pnpm does not honor it and sets the package version with the default ^ as a prefix.

Close #3414

Co-authored-by: amit <amit@enso.security>
2021-05-06 14:50:28 +03:00

5 lines
223 B
TypeScript

export default function getPinnedVersion (opts: { saveExact?: boolean, savePrefix?: string }) {
if (opts.saveExact === true || opts.savePrefix === '') return 'patch'
return opts.savePrefix === '~' ? 'minor' : 'major'
}