Skip to content

Commit

Permalink
fix(common): Fix signature of for objects (make target optional)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthielen committed Jan 30, 2018
1 parent 5a78f47 commit 61d0afc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export function find(collection: any, callback: any) {
export let mapObj: <T, U>(collection: { [key: string]: T }, callback: Mapper<T, U>, target?: typeof collection) => { [key: string]: U } = map;
/** Given an array, returns a new array, where each element is transformed by the callback function */
export function map<T, U>(collection: T[], callback: Mapper<T, U>, target?: typeof collection): U[];
export function map<T, U>(collection: { [key: string]: T }, callback: Mapper<T, U>, target: typeof collection): { [key: string]: U };
export function map<T, U>(collection: { [key: string]: T }, callback: Mapper<T, U>, target?: typeof collection): { [key: string]: U };
/** Maps an array or object properties using a callback function */
export function map(collection: any, callback: any, target: typeof collection): any {
target = target || (isArray(collection) ? [] : {});
Expand Down

0 comments on commit 61d0afc

Please sign in to comment.