Type alias CapitalizeObjectKeys<T>

CapitalizeObjectKeys<T>: {
    [key in CapitalizeKeys<T>]: Uncapitalize<key> extends keyof T
        ? T[Uncapitalize<key>]
        : never
}

TypeScript 類型,把 T 所有屬性替換成大寫開頭

Type Parameters

  • T extends object

    類型

Example

type CamelCase = { fooFoo: number, bazBaz: { barBar: number } };
type PascalCase = CapitalizeObjectKeys<CamelCase> // => { FooFoo: number, BazBaz: { barBar: number } };

Generated using TypeDoc