diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/semver/bin | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) | |
download | wallet-core-bbff7403fbf46f9ad92240ac213df8d30ef31b64.tar.xz |
update packages
Diffstat (limited to 'node_modules/semver/bin')
-rwxr-xr-x | node_modules/semver/bin/semver | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/node_modules/semver/bin/semver b/node_modules/semver/bin/semver index c5f2e857e..dddbcdf11 100755 --- a/node_modules/semver/bin/semver +++ b/node_modules/semver/bin/semver @@ -12,6 +12,7 @@ var argv = process.argv.slice(2) , inc = null , version = require("../package.json").version , loose = false + , coerce = false , identifier = undefined , semver = require("../semver") , reverse = false @@ -54,6 +55,9 @@ function main () { case "-r": case "--range": range.push(argv.shift()) break + case "-c": case "--coerce": + coerce = true + break case "-h": case "--help": case "-?": return help() default: @@ -62,8 +66,10 @@ function main () { } } - versions = versions.filter(function (v) { - return semver.valid(v, loose) + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v) || {version: v}).version : v + }).filter(function (v) { + return semver.valid(v) }) if (!versions.length) return fail() if (inc && (versions.length !== 1 || range.length)) @@ -122,6 +128,10 @@ function help () { ,"-l --loose" ," Interpret versions and ranges loosely" ,"" + ,"-c --coerce" + ," Coerce a string into SemVer if possible" + ," (does not imply --loose)" + ,"" ,"Program exits successfully if any valid version satisfies" ,"all supplied ranges, and prints all satisfying versions." ,"" |