Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hyperone/cli-framework

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyperone/cli-framework - npm Package Compare versions

Comparing version 1.0.8 to 1.0.12

error.js

17

category.js

@@ -6,2 +6,3 @@

import Command from './command';
import { NotFoundCommandError, AlreadyLoadedError } from '@hyperone/cli-framework/error';

@@ -59,3 +60,3 @@ class Category extends Command {

if (this.loaded) {
throw new Error('No late to add new lazy command');
throw new AlreadyLoadedError('No late to add new lazy command');
}

@@ -94,11 +95,7 @@ this.lazyCommands.push(cmd);

}
const result = meant(allOpts.command, this.commands.map(x => x.name));
const msg = [
`Error: unknown command "${allOpts.command}" for "${this.name}".`,
];
if (result.length > 0) {
msg.push('Did you mean this?');
msg.push(...result.map(x => `\t${x}`));
}
return msg.join('\n');
const suggestion = meant(allOpts.command, this.commands.map(x => x.name));
throw new NotFoundCommandError(
`Unknown command "${allOpts.command}" for "${this.getFullName()}".`,
suggestion
);
}

@@ -105,0 +102,0 @@

@@ -6,2 +6,3 @@

import { resolvePointer, serializeValue } from './utils';
import { UnknownOptionError} from './error';

@@ -97,16 +98,8 @@ class Command {

const option = opts._unknown[0];
const subname = options.map(x => `--${x.name}`);
const result = meant(option, subname);
const msg = [
`Error: unknown option "${option}" for "${this.name}".`,
];
if (result.length > 0) {
msg.push('Did you mean this?');
msg.push(...result.map(x => `\t${x}`));
}
return msg.join('\n');
const suggestion = meant(option, options.map(x => `--${x.name}`));
throw new UnknownOptionError(`Unknown parameter "${option}" for "${this.getFullName()}"`, suggestion);
}
const missing = options.filter(x => x.required && typeof allOpts[x.name] == 'undefined').map(x => `--${x.name}`);
if (missing.length > 0) {
return `Argument missing: ${missing.join(', ')}`;
throw new UnknownOptionError(`Parameter missing: ${missing.join(', ')}`, missing);
}

@@ -113,0 +106,0 @@ let p = Promise.resolve();

{
"name": "@hyperone/cli-framework",
"version": "1.0.8",
"version": "1.0.12",
"description": "",

@@ -20,3 +20,3 @@ "main": "index.js",

},
"gitHead": "a3a4d4cf6ce542757ec9adbc129f9b93bea9380e"
"gitHead": "0e4a91ccb71944831bdce5a123e2c66db02f8d4c"
}
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