diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index eb5ddec0..5f2d6577 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -7,7 +7,7 @@ jobs: release-please: runs-on: ubuntu-latest steps: - - uses: bcoe/release-please-action@v2.5.5 + - uses: bcoe/release-please-action@v2.6.0 id: release with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/lib/common-types.ts b/lib/common-types.ts deleted file mode 100644 index 8b02498d..00000000 --- a/lib/common-types.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * An object whose all properties have the same type, where each key is a string. - */ -export interface Dictionary { - [key: string]: T; -} - -/** - * Returns the keys of T. - */ -export type KeyOf = { - [K in keyof T]: string extends K ? never : number extends K ? never : K -} extends { [_ in keyof T]: infer U } ? U : never; - -/** - * Returns the type of a Dictionary or array values. - */ -export type ValueOf = T extends (infer U)[] ? U : T[keyof T]; diff --git a/lib/yargs-parser-types.ts b/lib/yargs-parser-types.ts index 1f3b9c36..e69af68c 100644 --- a/lib/yargs-parser-types.ts +++ b/lib/yargs-parser-types.ts @@ -1,4 +1,21 @@ -import type { Dictionary, KeyOf, ValueOf } from './common-types.js' +/** + * An object whose all properties have the same type, where each key is a string. + */ +export interface Dictionary { + [key: string]: T; +} + +/** + * Returns the keys of T. + */ +export type KeyOf = { + [K in keyof T]: string extends K ? never : number extends K ? never : K +} extends { [_ in keyof T]: infer U } ? U : never; + +/** + * Returns the type of a Dictionary or array values. + */ +export type ValueOf = T extends (infer U)[] ? U : T[keyof T]; export type ArgsInput = string | any[]; diff --git a/lib/yargs-parser.ts b/lib/yargs-parser.ts index ffc4c639..02cc1272 100644 --- a/lib/yargs-parser.ts +++ b/lib/yargs-parser.ts @@ -9,6 +9,7 @@ import type { DefaultValuesForType, DefaultValuesForTypeKey, DetailedArguments, + Dictionary, Flag, Flags, FlagsKey, @@ -19,9 +20,9 @@ import type { CoercionsFlag, Options, OptionsDefault, + ValueOf, YargsParserMixin } from './yargs-parser-types.js' -import type { Dictionary, ValueOf } from './common-types.js' import { camelCase, decamelize, looksLikeNumber } from './string-utils.js' let mixin: YargsParserMixin