From 6eca78ad316c02590b3b114491bda857e73d04a6 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Mon, 10 Oct 2022 14:19:55 +0200 Subject: [PATCH] Augment flag keys in ".flags" type definition Fixes #155 --- index.d.ts | 7 +++++-- index.test-d.ts | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index 30bd960..31e906a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,7 @@ -import {PackageJson} from 'type-fest'; +import { + CamelCasedProperties, + PackageJson, +} from 'type-fest'; export type FlagType = 'string' | 'boolean' | 'number'; @@ -246,7 +249,7 @@ export interface Result { /** Flags converted to camelCase excluding aliases. */ - flags: TypedFlags & Record; + flags: CamelCasedProperties> & Record; /** Flags converted camelCase including aliases. diff --git a/index.test-d.ts b/index.test-d.ts index 81463b3..1677e6b 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -64,7 +64,7 @@ expectType(result.pkg); expectType(result.help); expectType(result.flags.foo); -expectType(result.flags.fooBar); +expectType(result.flags.fooBar); expectType(result.flags.bar); expectType(result.flags.abc); expectType(result.unnormalizedFlags.foo); diff --git a/package.json b/package.json index d4e20bb..f7890b8 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "read-pkg-up": "^8.0.0", "redent": "^4.0.0", "trim-newlines": "^4.0.2", - "type-fest": "^1.2.2", + "type-fest": "^3.1.0", "yargs-parser": "^20.2.9" }, "devDependencies": {