Skip to main content

Function: omitUndefined()

function omitUndefined<T>(value): T;

Defined in: packages/overcast-core/src/config-schema.ts:460

Drop the keys whose value is undefined.

Load-bearing rather than tidiness: every layer's *Config() resolves its defaults by spreading a caller's overrides over a defaults object, so a key that is present and undefined overwrites the default instead of falling back to it. Applied inside those functions, so no caller can get it wrong — which is what lets a host build overrides by any means (a mapped object, a spread of optional fields) without knowing this rule exists.

Type Parameters

Type Parameter
T extends object

Parameters

ParameterType
valueT

Returns

T