preferred-node-version
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -1,35 +0,13 @@ | ||
import{cwd as getCwd}from"process"; | ||
import isPlainObj from"is-plain-obj"; | ||
import{excludeKeys}from"filter-obj"; | ||
import{validate,multipleValidOptions}from"jest-validate"; | ||
export const getOpts=function(opts={}){ | ||
validate(opts,{exampleConfig:EXAMPLE_OPTS()}); | ||
if(!isPlainObj(opts)){ | ||
throw new TypeError(`Options must be a plain object: ${opts}`); | ||
} | ||
const optsA=excludeKeys(opts,isUndefined); | ||
const optsB={...DEFAULT_OPTS(),...optsA}; | ||
const{cwd,global:globalOpt,fetch:fetchOpt,mirror}=optsB; | ||
const{cwd=".",global:globalOpt=false,fetch:fetchOpt,mirror}=opts; | ||
const nodeVersionAliasOpts={fetch:fetchOpt,mirror}; | ||
return{cwd,globalOpt,nodeVersionAliasOpts}; | ||
}; | ||
const DEFAULT_OPTS=()=>({ | ||
cwd:".", | ||
global:false}); | ||
const EXAMPLE_OPTS=()=>({ | ||
...DEFAULT_OPTS(), | ||
cwd:multipleValidOptions(getCwd(),new URL(".",import.meta.url)), | ||
fetch:true, | ||
mirror:"https://nodejs.org/dist"}); | ||
const isUndefined=function(key,value){ | ||
return value===undefined; | ||
}; | ||
//# sourceMappingURL=options.js.map |
{ | ||
"name": "preferred-node-version", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"type": "module", | ||
@@ -49,6 +49,4 @@ "exports": "./build/src/main.js", | ||
"dependencies": { | ||
"filter-obj": "^5.1.0", | ||
"is-plain-obj": "^4.1.0", | ||
"jest-validate": "^28.1.3", | ||
"node-version-alias": "^3.2.0", | ||
"node-version-alias": "^3.3.0", | ||
"p-locate": "^6.0.0", | ||
@@ -58,5 +56,5 @@ "path-type": "^5.0.0" | ||
"devDependencies": { | ||
"@ehmicky/dev-tasks": "^1.0.84", | ||
"@ehmicky/dev-tasks": "^1.0.94", | ||
"@types/node": "^18.0.0", | ||
"test-each": "^5.2.0" | ||
"test-each": "^5.4.0" | ||
}, | ||
@@ -63,0 +61,0 @@ "engines": { |
[![Codecov](https://img.shields.io/codecov/c/github/ehmicky/preferred-node-version.svg?label=tested&logo=codecov)](https://codecov.io/gh/ehmicky/preferred-node-version) | ||
[![Node](https://img.shields.io/node/v/preferred-node-version.svg?logo=node.js)](https://www.npmjs.com/package/preferred-node-version) | ||
[![TypeScript](https://img.shields.io/badge/-typed-brightgreen?logo=typescript&colorA=gray)](/src/main.d.ts) | ||
[![TypeScript](https://img.shields.io/badge/-typed-brightgreen?logo=typescript&colorA=gray&logoColor=0096ff)](/src/main.d.ts) | ||
[![Node](https://img.shields.io/node/v/preferred-node-version.svg?logo=node.js&logoColor=66cc33)](https://www.npmjs.com/package/preferred-node-version) | ||
[![Twitter](https://img.shields.io/badge/%E2%80%8B-twitter-brightgreen.svg?logo=twitter)](https://twitter.com/intent/follow?screen_name=ehmicky) | ||
@@ -5,0 +5,0 @@ [![Medium](https://img.shields.io/badge/%E2%80%8B-medium-brightgreen.svg?logo=medium)](https://medium.com/@ehmicky) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
4
0
29415
294
- Removedfilter-obj@^5.1.0
- Removedjest-validate@^28.1.3
- Removed@jest/schemas@28.1.3(transitive)
- Removed@jest/types@28.1.3(transitive)
- Removed@sinclair/typebox@0.24.51(transitive)
- Removed@types/istanbul-lib-coverage@2.0.6(transitive)
- Removed@types/istanbul-lib-report@3.0.3(transitive)
- Removed@types/istanbul-reports@3.0.4(transitive)
- Removed@types/node@22.9.0(transitive)
- Removed@types/yargs@17.0.33(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-styles@4.3.05.2.0(transitive)
- Removedcamelcase@6.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedjest-get-type@28.0.2(transitive)
- Removedjest-validate@28.1.3(transitive)
- Removedleven@3.1.0(transitive)
- Removedpretty-format@28.1.3(transitive)
- Removedreact-is@18.3.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedundici-types@6.19.8(transitive)
Updatednode-version-alias@^3.3.0