Skip to main content

JSONed

@webda/models


Type Alias: JSONed<T>

JSONed<T> = T extends object ? ReturnType<T["toJSON"]> : T extends any[] ? T : T extends object ? Pick<T, Extract<Attributes<T>, string>> : T

Defined in: packages/models/src/types.ts:69

JSON-friendly view of a type.

If the object has toJSON(), use its return type; otherwise, fallback to attributes-only object or the original type.

Type Parameters​

T​

T