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.
This commit is contained in:
George Kalpakas 2017-07-07 18:55:29 +03:00 committed by Jason Aden
parent 11db3bd85e
commit 6bae73c076
1 changed files with 1 additions and 1 deletions

View File

@ -172,7 +172,7 @@ function nameCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
} }
function combine(options: Intl.DateTimeFormatOptions[]): Intl.DateTimeFormatOptions { function combine(options: Intl.DateTimeFormatOptions[]): Intl.DateTimeFormatOptions {
return (<any>Object).assign({}, ...options); return options.reduce((merged, opt) => ({...merged, ...opt}), {});
} }
function datePartGetterFactory(ret: Intl.DateTimeFormatOptions): DateFormatterFn { function datePartGetterFactory(ret: Intl.DateTimeFormatOptions): DateFormatterFn {