ccc-tnt-psd2ui/npm-packages/mac-v2.4.x/semver/internal/parse-options.js

12 lines
383 B
JavaScript
Raw Normal View History

2023-07-27 07:04:13 +00:00
// 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((o, k) => {
o[k] = true
return o
}, {})
2023-07-24 03:13:08 +00:00
module.exports = parseOptions