refactor(facade): Remove most of StringMapWrapper facade. (#12022)
This change mostly automated by
12012b07a2
with some manual fixes.
This commit is contained in:

committed by
Chuck Jazdzewski

parent
ed9c2b6281
commit
b64b5ece65
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {StringMapWrapper} from './facade/collection';
|
||||
|
||||
import {global, isString} from './facade/lang';
|
||||
import {getDOM} from './private_import_platform-browser';
|
||||
|
||||
@ -190,9 +190,9 @@ _global.beforeEach(function() {
|
||||
if (isString(styles)) {
|
||||
allPassed = getDOM().hasStyle(actual, styles);
|
||||
} else {
|
||||
allPassed = !StringMapWrapper.isEmpty(styles);
|
||||
StringMapWrapper.forEach(styles, (style: string, prop: string) => {
|
||||
allPassed = allPassed && getDOM().hasStyle(actual, prop, style);
|
||||
allPassed = Object.keys(styles).length !== 0;
|
||||
Object.keys(styles).forEach(prop => {
|
||||
allPassed = allPassed && getDOM().hasStyle(actual, prop, styles[prop]);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -9,8 +9,6 @@
|
||||
import {AnimationPlayer} from '@angular/core';
|
||||
import {MockAnimationPlayer} from '@angular/core/testing/testing_internal';
|
||||
import {AnimationDriver} from '@angular/platform-browser';
|
||||
|
||||
import {StringMapWrapper} from './facade/collection';
|
||||
import {AnimationKeyframe, AnimationStyles} from './private_import_core';
|
||||
|
||||
export class MockAnimationDriver extends AnimationDriver {
|
||||
@ -40,7 +38,7 @@ function _serializeKeyframes(keyframes: AnimationKeyframe[]): any[] {
|
||||
function _serializeStyles(styles: AnimationStyles): {[key: string]: any} {
|
||||
var flatStyles: {[key: string]: any} = {};
|
||||
styles.styles.forEach((entry: {[key: string]: string | number;}) => {
|
||||
StringMapWrapper.forEach(entry, (val: any, prop: string) => { flatStyles[prop] = val; });
|
||||
Object.keys(entry).forEach(prop => { flatStyles[prop] = entry[prop]; });
|
||||
});
|
||||
return flatStyles;
|
||||
}
|
||||
|
Reference in New Issue
Block a user