Skip to content

removeUndefinedProperties<Type>

Removes all undefined properties from an object.

Import:

import { removeUndefinedProperties } from 'obsidian-dev-utils/object-utils';

Signature:

function removeUndefinedProperties($object: Type, keysToKeep: readonly string[] | undefined): Type

Parameters:

ParameterTypeDescription
$objectType
keysToKeepreadonly string[] | undefinedThe keys to keep.

Returns: Type — The object with all undefined properties removed.