mirror of
				https://github.com/1disk/edp445.git
				synced 2024-08-14 22:47:02 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			11 lines
		
	
	
	
		
			383 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			11 lines
		
	
	
	
		
			383 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((o, k) => {
 | |
|     o[k] = true
 | |
|     return o
 | |
|   }, {})
 | |
| module.exports = parseOptions
 |