版博士V2.0程序
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.
 
 
 
 

12 lines
383 B

  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((o, k) => {
  8. o[k] = true
  9. return o
  10. }, {})
  11. module.exports = parseOptions