refactor(router): use object spread operator instead of merge fn

This commit is contained in:
Dzmitry Shylovich
2017-03-26 17:15:10 +03:00
committed by Victor Berchet
parent b7fa5dec21
commit 606b8fafb0
5 changed files with 12 additions and 30 deletions

View File

@ -63,24 +63,6 @@ export function and(bools: boolean[]): boolean {
return !bools.some(v => !v);
}
export function merge<V>(m1: {[key: string]: V}, m2: {[key: string]: V}): {[key: string]: V} {
const m: {[key: string]: V} = {};
for (const attr in m1) {
if (m1.hasOwnProperty(attr)) {
m[attr] = m1[attr];
}
}
for (const attr in m2) {
if (m2.hasOwnProperty(attr)) {
m[attr] = m2[attr];
}
}
return m;
}
export function forEach<K, V>(map: {[key: string]: V}, callback: (v: V, k: string) => void): void {
for (const prop in map) {
if (map.hasOwnProperty(prop)) {