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:
parent
11db3bd85e
commit
6bae73c076
|
@ -172,7 +172,7 @@ function nameCondition(prop: string, len: number): 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 {
|
||||
|
|
Loading…
Reference in New Issue