Skip to content

Commit

Permalink
Fix typings for object-reduce(use default export) (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamashita Shinichi authored Nov 19, 2022
1 parent 35a4968 commit 512ca6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/object-reduce/index.d.ts
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
2 changes: 1 addition & 1 deletion packages/object-reduce/index.tests.ts
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 };

Expand Down

0 comments on commit 512ca6c

Please sign in to comment.