Skip to content

Commit 2415fcb

Browse files
committed
chore: Remove removeUndefinedKeys
1 parent 67f7516 commit 2415fcb

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

lib/internal/util.spec.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, expect, test } from "bun:test";
2-
import { removeUndefinedKeys, toUpperCamelCase } from "./util";
2+
import { toUpperCamelCase } from "./util";
33

44
describe("toUpperCamelCase", () => {
55
test.each([
@@ -30,12 +30,3 @@ describe("toUpperCamelCase", () => {
3030
expect(toUpperCamelCase(input)).toBe(expected);
3131
});
3232
});
33-
34-
describe("removeUndefinedKeys", () => {
35-
test.each([
36-
[{ foo: "bar", baz: undefined }, ["foo"]],
37-
[{ foo: "bar", baz: undefined, hoge: "fuga" }, ["foo", "hoge"]],
38-
])("removeUndefinedKeys(%j) returns %j", (input, expected) => {
39-
expect(Object.keys(removeUndefinedKeys(input))).toEqual(expected);
40-
});
41-
});

lib/internal/util.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,3 @@ export function toUpperCamelCase(str: string): string {
44
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
55
.join("");
66
}
7-
8-
export function removeUndefinedKeys<T extends Record<string, unknown>>(
9-
obj: T,
10-
): Partial<T> {
11-
return Object.fromEntries(
12-
Object.entries(obj).filter(([_, value]) => value !== undefined),
13-
) as Partial<T>;
14-
}

0 commit comments

Comments
 (0)