This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): update dependency filter-obj to v5 (#1246)
* fix(deps): update dependency filter-obj to v5 * chore: migrate to new API Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Daniel Tschinder <231804+danez@users.noreply.github.com>
- Loading branch information
1 parent
93aed16
commit 5d02ad8
Showing
3 changed files
with
16 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import filterObj from 'filter-obj' | ||
import { includeKeys } from 'filter-obj' | ||
|
||
const isUndefined = (key: unknown, value: unknown) => value !== undefined | ||
|
||
export const removeUndefined = function <T extends { [key: string]: unknown }>(obj: T): T { | ||
return filterObj(obj, (key, value) => value !== undefined) as T | ||
return includeKeys(obj, isUndefined) as T | ||
} |
5d02ad8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⏱ Benchmark results
largeDepsEsbuild: 2.5s
largeDepsNft: 12.4s
largeDepsZisi: 18.6s