@clerc/core
Advanced tools
Comparing version 0.13.2 to 0.14.0
@@ -305,2 +305,5 @@ import * as _clerc_utils from '@clerc/utils'; | ||
} | ||
declare class NoCommandGivenError extends Error { | ||
constructor(); | ||
} | ||
declare class ParentCommandExistsError extends Error { | ||
@@ -344,2 +347,2 @@ constructor(name: string); | ||
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandWithHandler, CommonCommandExistsError, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Handler, HandlerContext, HandlerInCommand, Inspector, InspectorContext, InspectorFn, InspectorObject, MakeEventMap, MultipleCommandsMatchedError, NameNotSetError, NoSuchCommandError, ParentCommandExistsError, Plugin, PossibleInputKind, SingleCommand, SingleCommandAliasError, SingleCommandError, SingleCommandType, SubcommandExistsError, VersionNotSetError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; | ||
export { Clerc, Command, CommandAlias, CommandCustomProperties, CommandExistsError, CommandNameConflictError, CommandOptions, CommandRecord, CommandWithHandler, CommonCommandExistsError, DescriptionNotSetError, FallbackType, Flag, FlagOptions, Handler, HandlerContext, HandlerInCommand, Inspector, InspectorContext, InspectorFn, InspectorObject, MakeEventMap, MultipleCommandsMatchedError, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParentCommandExistsError, Plugin, PossibleInputKind, SingleCommand, SingleCommandAliasError, SingleCommandError, SingleCommandType, SubcommandExistsError, VersionNotSetError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; |
@@ -31,5 +31,10 @@ import { LiteEmit } from 'lite-emit'; | ||
} | ||
class NoCommandGivenError extends Error { | ||
constructor() { | ||
super("No command given."); | ||
} | ||
} | ||
class ParentCommandExistsError extends Error { | ||
constructor(name) { | ||
super(`Command "${name}" cannot exist with its parent`); | ||
super(`Command "${name}" cannot exist with its parent.`); | ||
} | ||
@@ -39,3 +44,3 @@ } | ||
constructor(name) { | ||
super(`Command "${name}" cannot exist with its subcommand`); | ||
super(`Command "${name}" cannot exist with its subcommand.`); | ||
} | ||
@@ -381,3 +386,7 @@ } | ||
if (!command) { | ||
throw new NoSuchCommandError(stringName); | ||
if (stringName) { | ||
throw new NoSuchCommandError(stringName); | ||
} else { | ||
throw new NoCommandGivenError(); | ||
} | ||
} | ||
@@ -414,2 +423,2 @@ __privateGet(this, _commandEmitter).emit(command.name, handlerContext); | ||
export { Clerc, CommandExistsError, CommandNameConflictError, CommonCommandExistsError, DescriptionNotSetError, MultipleCommandsMatchedError, NameNotSetError, NoSuchCommandError, ParentCommandExistsError, SingleCommand, SingleCommandAliasError, SingleCommandError, SubcommandExistsError, VersionNotSetError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; | ||
export { Clerc, CommandExistsError, CommandNameConflictError, CommonCommandExistsError, DescriptionNotSetError, MultipleCommandsMatchedError, NameNotSetError, NoCommandGivenError, NoSuchCommandError, ParentCommandExistsError, SingleCommand, SingleCommandAliasError, SingleCommandError, SubcommandExistsError, VersionNotSetError, compose, defineCommand, defineHandler, defineInspector, definePlugin, mapParametersToArguments, parseParameters, resolveArgv, resolveCommand, resolveFlattenCommands, resolveParametersBeforeFlag, resolveRootCommands, resolveSubcommandsByParent }; |
{ | ||
"name": "@clerc/core", | ||
"version": "0.13.2", | ||
"version": "0.14.0", | ||
"author": "Ray <nn_201312@163.com> (https://github.com/so1ve)", | ||
@@ -53,3 +53,3 @@ "description": "Clerc core", | ||
"type-flag": "^3.0.0", | ||
"@clerc/utils": "0.13.2" | ||
"@clerc/utils": "0.14.0" | ||
}, | ||
@@ -56,0 +56,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
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
45724
1171
+ Added@clerc/utils@0.14.0(transitive)
- Removed@clerc/utils@0.13.2(transitive)
Updated@clerc/utils@0.14.0