-
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.
Fix typings for object-reduce(use default export) (#500)
- Loading branch information
Yamashita Shinichi
authored
Nov 19, 2022
1 parent
35a4968
commit 512ca6c
Showing
2 changed files
with
4 additions
and
2 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,8 +1,10 @@ | ||
type Predicate<T extends object, Acc> = | ||
(acc: Acc, key: keyof T, value: T[keyof T], index: number, keys: Array<keyof T>) => Acc | ||
|
||
export function reduce<T extends object, Acc>( | ||
declare function reduce<T extends object, Acc>( | ||
obj: T, | ||
predicate: Predicate<T, Acc>, | ||
initialValue?: Acc | ||
): Acc | ||
|
||
export default reduce |
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,4 +1,4 @@ | ||
import { reduce } from './index'; | ||
import reduce from './index'; | ||
|
||
const obj = { a: 3, b: 4, c: 9 }; | ||
|
||
|