webhook-action/node_modules/semver/internal/parse-options.js

12 lines
383 B
JavaScript
Raw Normal View History

// 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 }
2022-11-10 10:43:16 +00:00
: opts.filter(k => options[k]).reduce((o, k) => {
o[k] = true
return o
}, {})
module.exports = parseOptions