Skip to content

coerceOptional()

ts
function coerceOptional<S>(catalog, value): CatalogValue<S> | undefined;

Valida value contra catalog, dejando pasar undefined y null.

Type Parameters

Type Parameter
S extends Readonly<Record<string, readonly [string | number, string]>>

Parameters

ParameterType
catalogCatalog<S>
valueunknown

Returns

CatalogValue<S> | undefined