Skip to content

cleanObject

@tsed/core

Usage

typescript
import { cleanObject } from "@tsed/core";

See /packages/core/src/utils/cleanObject.ts.

Overview

ts
function cleanObject(obj: Record<string, unknown>, ignore?: string[]): any;

Description

Returns a copy of an object with undefined values, protected keys, and ignored keys removed.

Filters out entries that are undefined, match protected key patterns, or are in the ignore list.

Released under the MIT License.