-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This lets the function pass through more specific type information
- Loading branch information
Zanchi
committed
Apr 22, 2022
1 parent
3fd356a
commit b3fac98
Showing
2 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
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,6 +1,6 @@ | ||
declare function map<T, U = T>( | ||
item: Record<string, T>, | ||
callback: (key: string, value: T) => U | ||
): Record<string, U>; | ||
declare function map<K extends string | number | symbol, T, U = T>( | ||
item: Record<K, T>, | ||
callback: (key: K, value: T) => U | ||
): Record<K, U> | ||
|
||
export default map; |
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