Skip to content

ensureGenericObject<T>

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

Import:

import { ensureGenericObject } from 'obsidian-dev-utils/type-guards';

Signature:

function ensureGenericObject(obj: T): GenericObject<T>

Parameters:

ParameterTypeDescription
objTThe value to ensure.

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