UNPKG

node-version-alias

Version:

Resolve Node.js version aliases like 'latest', 'lts' or 'erbium'

13 lines (10 loc) 343 B
import isPlainObj from"is-plain-obj"; export const getOpts=(opts={})=>{ if(!isPlainObj(opts)){ throw new TypeError(`Options must be a plain object: ${opts}`) } const{fetch:fetchOpt,mirror,signal}=opts; const normalizeOpts={fetch:fetchOpt,mirror,signal}; const allNodeOpts={fetch:fetchOpt,mirror,signal}; return{normalizeOpts,allNodeOpts} };