Skip to content
Alchemy Logo

filterUndefined | @aa-sdk/core

function filterUndefined<T>(obj): T;

Defined in: aa-sdk/core/src/utils/index.ts:99

Filters out properties with undefined or null values from the provided object.

import { filterUndefined } from "@aa-sdk/core";
 
const result = filterUndefined({
  foo: undefined,
  bar: null,
  baz: "baz",
}); // { baz: "baz" }

Type Parameter

T

ParameterTypeDescription

obj

T

the object from which to remove properties with undefined or null values

T

the object with undefined or null properties removed

Was this page helpful?