Last change
on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
401 bytes
|
Line | |
---|
1 | // parse out just the options we care about so we always get a consistent
|
---|
2 | // obj with keys in a consistent order.
|
---|
3 | const opts = ['includePrerelease', 'loose', 'rtl']
|
---|
4 | const parseOptions = options =>
|
---|
5 | !options ? {}
|
---|
6 | : typeof options !== 'object' ? { loose: true }
|
---|
7 | : opts.filter(k => options[k]).reduce((options, k) => {
|
---|
8 | options[k] = true
|
---|
9 | return options
|
---|
10 | }, {})
|
---|
11 | module.exports = parseOptions
|
---|
Note:
See
TracBrowser
for help on using the repository browser.