Skip to content

Commit

Permalink
perf: improve omit performance (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
linxianxi authored Jun 12, 2024
1 parent b072ce1 commit 26f84c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/omit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default function omit<T extends object, K extends keyof T>(
obj: T,
fields: K[] | readonly K[],
): Omit<T, K> {
const clone = { ...obj };
const clone = Object.assign({}, obj);

if (Array.isArray(fields)) {
fields.forEach(key => {
Expand Down

0 comments on commit 26f84c8

Please sign in to comment.