From 61d0afc21ae69400930234f7bc507eb5bf7613b1 Mon Sep 17 00:00:00 2001 From: Chris Thielen Date: Tue, 30 Jan 2018 08:52:02 -0800 Subject: [PATCH] fix(common): Fix signature of for objects (make target optional) --- src/common/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/common.ts b/src/common/common.ts index 2fb52fa6..62255e58 100644 --- a/src/common/common.ts +++ b/src/common/common.ts @@ -295,7 +295,7 @@ export function find(collection: any, callback: any) { export let mapObj: (collection: { [key: string]: T }, callback: Mapper, 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(collection: T[], callback: Mapper, target?: typeof collection): U[]; -export function map(collection: { [key: string]: T }, callback: Mapper, target: typeof collection): { [key: string]: U }; +export function map(collection: { [key: string]: T }, callback: Mapper, 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) ? [] : {});