UNPKG

@data-client/rest

Version:

Quickly define typed REST resources and endpoints

8 lines (5 loc) 256 B
import { Schema } from '@data-client/endpoint'; import { ExtractCollection } from './extractCollection.js'; export type ExtractObject<S extends Record<string, any>> = { [K in keyof S]: S[K] extends Schema ? ExtractCollection<S[K]> : never; }[keyof S];