From 6c57fc88bae413d5bc956bb68a5e9b25bb277980 Mon Sep 17 00:00:00 2001 From: Pelle Wessman Date: Tue, 11 Oct 2022 05:36:20 +0200 Subject: [PATCH] Improve TypeScript types (#218) --- 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": {