UNPKG

convert-cases

Version:

A minimal utility function library that converts camelCase to snake_case and snake_case to camelCase.

6 lines (5 loc) 308 B
import type { CamelToSnake } from './camel-to-snake'; export declare type DeepSnakies<T> = T extends (infer U)[] ? DeepSnakies<U>[] : T extends object ? { [K in keyof T as CamelToSnake<K & string>]: DeepSnakies<T[K]>; } : T; export declare const deeplySnakize: <T, U = DeepSnakies<T>>(obj: T) => U;