This packages exposes types that allow you to extract deeply nested types.
type DeepExtractTypeSkipArrays<Source, Path extends [...string[]]>
Extracts a deeply-nested type from the target Path
in Source
, skipping arrays and ignoring null|undefined|optional types:
;// will be { name: string };
type DeepExtractType<Source, Path extends [...(string | number)[]]>
Extracts a deeply-nested type from the target Path
in Source
, ignoring null|undefined|optional types:
;// will be { title: string };