10
0
Fork 0
mirror of https://github.com/Azure/setup-helm.git synced 2026-04-15 02:54:46 +00:00
setup-helm/node_modules/node-notifier/node_modules/semver/internal/parse-options.js
2022-01-26 21:54:27 +00:00

11 lines
401 B
JavaScript

// parse out just the options we care about so we always get a consistent
// obj with keys in a consistent order.
const opts = ['includePrerelease', 'loose', 'rtl']
const parseOptions = options =>
!options ? {}
: typeof options !== 'object' ? { loose: true }
: opts.filter(k => options[k]).reduce((options, k) => {
options[k] = true
return options
}, {})
module.exports = parseOptions