sheng-tool
    Preparing search index...

    Type Alias TransformObjectKeys<T, Format>

    TransformObjectKeys: T extends BuiltIn
        ? T
        : T extends readonly [unknown, ...unknown[]]
            ? { [Index in keyof T]: TransformObjectKeys<T[Index], Format> }
            : T extends readonly (infer Item)[]
                ? T extends (infer MutableItem)[]
                    ? TransformObjectKeys<MutableItem, Format>[]
                    : readonly TransformObjectKeys<Item, Format>[]
                : T extends object
                    ? {
                        [K in keyof T as TransformKey<K, Format>]: TransformObjectKeys<
                            T[K],
                            Format,
                        >
                    }
                    : T

    按指定格式递归转换对象 key 的类型。

    只递归普通对象、数组和元组;Date、RegExp、Map、Set、函数、Promise 等内建对象会保持原类型。 这个类型描述的是运行时转换后的公开结果,不会保留转换前的旧 key。

    Type Parameters

    • T
    • Format extends KeyFormat

    0.1.0