mirror of
https://github.com/BradNut/TofuStack
synced 2025-09-08 17:40:26 +00:00
16 lines
325 B
TypeScript
16 lines
325 B
TypeScript
|
|
export type SwapDatesWithStrings<T> = {
|
||
|
|
[k in keyof T]: T[k] extends Date | undefined
|
||
|
|
? string
|
||
|
|
: T[k] extends object
|
||
|
|
? SwapDatesWithStrings<T[k]>
|
||
|
|
: T[k];
|
||
|
|
};
|
||
|
|
|
||
|
|
export type Returned<T> = {
|
||
|
|
[k in keyof T]: T[k] extends Date | undefined
|
||
|
|
? string
|
||
|
|
: T[k] extends object
|
||
|
|
? SwapDatesWithStrings<T[k]>
|
||
|
|
: T[k];
|
||
|
|
};
|