mirror of
https://github.com/joelwmale/webhook-action.git
synced 2024-12-02 04:15:23 +01:00
12 lines
401 B
JavaScript
12 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
|