You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
383 B
11 lines
383 B
// 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 |
|
}, {}) |
|
module.exports = parseOptions
|
|
|