2023-05-07 03:37:34 -07:00
|
|
|
// parse out just the options we care about
|
|
|
|
const looseOption = Object.freeze({ loose: true })
|
|
|
|
const emptyOpts = Object.freeze({ })
|
|
|
|
const parseOptions = options => {
|
|
|
|
if (!options) {
|
|
|
|
return emptyOpts
|
|
|
|
}
|
|
|
|
|
|
|
|
if (typeof options !== 'object') {
|
|
|
|
return looseOption
|
|
|
|
}
|
|
|
|
|
|
|
|
return options
|
|
|
|
}
|
2020-12-04 15:51:55 -05:00
|
|
|
module.exports = parseOptions
|