Sha256: c0fe2b1135ca803efa203408c953e1e12645b8065e1a4c1336ad8bb11ea1101b
Contents?: true
Size: 864 Bytes
Versions: 61
Compression:
Stored size: 864 Bytes
Contents
import type {DelimiterCasedPropertiesDeep} from './delimiter-cased-properties-deep'; /** Convert object properties to snake case recursively. This can be useful when, for example, converting some API types from a different style. @see SnakeCase @see SnakeCasedProperties @example ``` import type {SnakeCasedPropertiesDeep} from 'type-fest'; interface User { userId: number; userName: string; } interface UserWithFriends { userInfo: User; userFriends: User[]; } const result: SnakeCasedPropertiesDeep<UserWithFriends> = { user_info: { user_id: 1, user_name: 'Tom', }, user_friends: [ { user_id: 2, user_name: 'Jerry', }, { user_id: 3, user_name: 'Spike', }, ], }; ``` @category Change case @category Template literal @category Object */ export type SnakeCasedPropertiesDeep<Value> = DelimiterCasedPropertiesDeep<Value, '_'>;
Version data entries
61 entries across 61 versions & 3 rubygems