Comparing version 0.3.3 to 0.3.4
@@ -0,1 +1,3 @@ | ||
import { MaybeArray, Dict, LiteralUnion } from '@clerc/utils'; | ||
declare const DOUBLE_DASH = "--"; | ||
@@ -69,19 +71,2 @@ declare type TypeFunction<ReturnType = any> = (value: any) => ReturnType; | ||
/** | ||
* Copied from type-fest | ||
*/ | ||
declare type Primitive = null | undefined | string | number | boolean | symbol | bigint; | ||
/** | ||
* Copied from type-fest | ||
*/ | ||
declare type LiteralUnion<LiteralType, BaseType extends Primitive> = LiteralType | (BaseType & Record<never, never>); | ||
declare type Dict<T> = Record<string, T>; | ||
declare type MustArray<T> = T extends any[] ? T : [T]; | ||
declare type MaybeArray<T> = T | T[]; | ||
declare type GetLength<T extends any[]> = T extends { | ||
length: infer L extends number; | ||
} ? L : never; | ||
declare type GetTail<T extends any[]> = T extends [infer _Head, ...infer Tail] ? Tail : never; | ||
declare type EnhanceSingle<T, E extends Dict<any>> = T & E; | ||
declare type Enhance<T, E extends Dict<any> | Dict<any>[]> = GetLength<MustArray<E>> extends 0 ? T : Enhance<EnhanceSingle<T, MustArray<E>[0]>, GetTail<MustArray<E>>>; | ||
declare type FlagOptions = FlagSchema & { | ||
@@ -116,2 +101,3 @@ description: string; | ||
parameters: PossibleInputKind[]; | ||
unknownFlags: ParsedFlags["unknownFlags"]; | ||
flags: TypeFlag<NonNullableFlag<C[N]["flags"]>>["flags"]; | ||
@@ -281,7 +267,2 @@ cli: Clerc<C>; | ||
declare const mustArray: <T>(a: MaybeArray<T>) => T[]; | ||
declare type CamelCase<T extends string> = T extends `${infer A}-${infer B}${infer C}` ? `${A}${Capitalize<B>}${CamelCase<C>}` : T; | ||
declare const camelCase: <T extends string>(s: T) => CamelCase<T>; | ||
declare type KebabCase<T extends string, A extends string = ""> = T extends `${infer F}${infer R}` ? KebabCase<R, `${A}${F extends Lowercase<F> ? "" : "-"}${Lowercase<F>}`> : A; | ||
declare const kebabCase: <T extends string>(s: T) => KebabCase<T, "">; | ||
declare const resolveFlagAlias: (_command: Command) => Dict<string[]>; | ||
@@ -293,2 +274,2 @@ declare const resolveFlagDefault: (_command: Command) => Dict<any>; | ||
export { CamelCase, Clerc, Command, CommandExistsError, CommandOptions, CommandRecord, CommonCommandExistsError, Dict, Enhance, FallbackType, Flag, FlagOptions, Handler, HandlerContext, Inspector, InspectorContext, KebabCase, LiteralUnion, MakeEventMap, MaybeArray, NoSuchCommandError, Plugin, PossibleInputKind, Primitive, SingleCommand, SingleCommandError, SingleCommandType, camelCase, compose, defineHandler, defineInspector, definePlugin, kebabCase, mustArray, resolveArgv, resolveCommand, resolveFlagAlias, resolveFlagDefault }; | ||
export { Clerc, Command, CommandExistsError, CommandOptions, CommandRecord, CommonCommandExistsError, FallbackType, Flag, FlagOptions, Handler, HandlerContext, Inspector, InspectorContext, MakeEventMap, NoSuchCommandError, Plugin, PossibleInputKind, SingleCommand, SingleCommandError, SingleCommandType, compose, defineHandler, defineInspector, definePlugin, resolveArgv, resolveCommand, resolveFlagAlias, resolveFlagDefault }; |
{ | ||
"name": "clerc", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"author": "Ray <nn_201312@163.com> (https://github.com/so1ve)", | ||
@@ -42,2 +42,3 @@ "description": "Clerc is a simple and easy-to-use cli framework.", | ||
"dependencies": { | ||
"@clerc/utils": "0.3.4", | ||
"is-platform": "^0.2.0", | ||
@@ -44,0 +45,0 @@ "lite-emit": "^1.4.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
21503
5
561
+ Added@clerc/utils@0.3.4
+ Added@clerc/utils@0.3.4(transitive)