Skip to content

Commit 26f84c8

Browse files
authored
perf: improve omit performance (#548)
1 parent b072ce1 commit 26f84c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/omit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default function omit<T extends object, K extends keyof T>(
22
obj: T,
33
fields: K[] | readonly K[],
44
): Omit<T, K> {
5-
const clone = { ...obj };
5+
const clone = Object.assign({}, obj);
66

77
if (Array.isArray(fields)) {
88
fields.forEach(key => {

0 commit comments

Comments
 (0)