Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ChildUpdateFields

Helper for calculating the nested fields for a given type T1. This is needed to distribute union types such as undefined | {...} (happens for optional props) or {a: A} | {b: B}.

In this use case, V is used to distribute the union types of T[K] on Record, since T[K] is evaluated as an expression and not distributed.

See https://www.typescriptlang.org/docs/handbook/advanced-types.html#distributive-conditional-types

type ChildUpdateFields<K extends string, V> = V extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<V>> : never;

§Type Parameters

§
K extends string
[src]

§Type

§
V extends Record<string, unknown> ? AddPrefixToKeys<K, UpdateData<V>> : never
[src]