ts-prime
Version:
A utility library for JavaScript and Typescript.
19 lines (18 loc) • 407 B
JavaScript
import { compact } from "./compact";
test("Compact test", function () {
expect(compact({
a: undefined,
b: null
})).toEqual({});
});
test("Compact test", function () {
expect(compact({
a: undefined,
b: [undefined],
x: {
zx: [{
a: undefined
}]
}
})).toEqual({ "b": [], "x": { "zx": [{}] } });
});