Skip to content

ensureGenericObject<T>

Ensures that a value is a generic object, returning it with narrowed type.

Import:

import { ensureGenericObject } from '@mnaoumov/typescript-lib/type-guards';

Signature:

function ensureGenericObject($object: T): GenericObject<T>

Parameters:

Parameter Type Description
$object T

Returns: GenericObject<T> — The value as a generic object.