UNPKG

ts-prime

Version:

A utility library for JavaScript and Typescript.

24 lines (22 loc) 455 B
import { compact } from "./compact" test("Compact test", () => { expect( compact({ a: undefined, b: null }) ).toEqual({}) }) test("Compact test", () => { expect( compact({ a: undefined, b: [undefined], x: { zx: [{ a: undefined }] } }) ).toEqual({ "b": [], "x": { "zx": [{}] } }) })