import { IfNoDeepValue } from './helpers.js'; import { DeeperNullish } from './nullish.js'; import { DeeperPartial } from './partial.js'; import { IfNever } from './type-check.js'; /** * Returns the given type as a Data Transfer Object (DTO) interface, Removes symbol keys and function properties. * @template T - The type of the data being transferred. */ export type DTO = { [K in keyof T as IfNever< Exclude, Function | symbol>, never, K >]: NonNullable extends (infer U)[] // Deep process arrays ? DTO[] : // Do not deep process No-Deep values IfNoDeepValue> extends true ? NonNullable : // Deep process objects DTO>; }; export type PartialDTO = DeeperPartial>; export type PatchDTO = DeeperNullish>;