New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

handle-cli-error

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

handle-cli-error - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

2

build/src/main.js

@@ -7,3 +7,5 @@ import normalizeException from"normalize-exception";

export{validateOptions}from"./options/validate.js";
export default function handleCliError(error,opts){

@@ -10,0 +12,0 @@ const errorA=normalizeException(error);

6

build/src/options/main.js

@@ -7,3 +7,3 @@ import normalizeException from"normalize-exception";

import{removeUndefined,applyDefaultOpts}from"./default.js";
import{validateOpts}from"./validate.js";
import{validateOptions}from"./validate.js";

@@ -15,2 +15,4 @@

}catch(error_){
error_.message=`handle-cli-error invalid usage: ${error_.message}`;
const errorA=normalizeException(error_);

@@ -22,3 +24,3 @@ return{error:errorA,opts:INVALID_OPTS};

const safeGetOpts=function(opts,error){
validateOpts(opts,["options"]);
validateOptions(opts);
const optsA=applyClassesOpts(error,opts);

@@ -25,0 +27,0 @@ const optsB=applyDefaultOpts(optsA);

@@ -7,3 +7,8 @@ import isPlainObj from"is-plain-obj";

export const validateOpts=function(opts,optName){
export const validateOptions=function(opts){
validateAllOpts(opts,[]);
};
const validateAllOpts=function(opts,optName){
if(opts===undefined){

@@ -78,3 +83,3 @@ return;

if(optName.length>2){
if(optName.length>1){
handleInvalidOpts("must not be defined",classes,optName);

@@ -84,3 +89,3 @@ }

Object.entries(classes).forEach(([className,classOpts])=>{
validateOpts(classOpts,[...optName,className]);
validateAllOpts(classOpts,[...optName,className]);
});

@@ -99,6 +104,4 @@ };

const fullOptName=optName.join(".");
throw new Error(
`handle-cli-error invalid usage: "${fullOptName}" ${message}: ${value}`);
throw new Error(`"${fullOptName}" ${message}: ${value}`);
};
//# sourceMappingURL=validate.js.map
{
"name": "handle-cli-error",
"version": "2.3.0",
"version": "2.4.0",
"type": "module",

@@ -5,0 +5,0 @@ "exports": "./build/src/main.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc