问题
Using the semver NPM package https://docs.npmjs.com/misc/semver
is there a way to convert a package version like so ^4.2.3
, to one that is without the ^
? I just need to do string manipulation to remove any preceding characters that are not numbers, I suppose.
回答1:
Ah yes, the answer is in the docs, of course: https://docs.npmjs.com/misc/semver
it says:
semver.clean(' =v1.2.3 ') // '1.2.3'
来源:https://stackoverflow.com/questions/48348948/use-semver-package-to-convert-4-2-3-to-4-2-3