From 6bae73c076688bec2d93a4adf558b1fd27031912 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Fri, 7 Jul 2017 18:55:29 +0300 Subject: [PATCH] refactor(common): replace `Object.assign` with the spread operator (#17982) `Object.assign` is not available in all supported browsers and one had to provide a polyfill. This commit replaces `Object.assign` with the spread operator (`...`), which TypeScript will transpile to ES5-compatible code. --- packages/common/src/pipes/intl.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/src/pipes/intl.ts b/packages/common/src/pipes/intl.ts index 8d786b22a1..483e89fd8c 100644 --- a/packages/common/src/pipes/intl.ts +++ b/packages/common/src/pipes/intl.ts @@ -172,7 +172,7 @@ function nameCondition(prop: string, len: number): Intl.DateTimeFormatOptions { } function combine(options: Intl.DateTimeFormatOptions[]): Intl.DateTimeFormatOptions { - return (Object).assign({}, ...options); + return options.reduce((merged, opt) => ({...merged, ...opt}), {}); } function datePartGetterFactory(ret: Intl.DateTimeFormatOptions): DateFormatterFn {