Skip to content

filterUndefined

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

Import

import { filterUndefined } from "@aa-sdk/core";

Usage

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

Parameters

obj

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

Returns

T the object with undefined or null properties removed