refactor: remove some facades (#12335)
This commit is contained in:

committed by
Alex Rickabaugh

parent
0ecd9b2df0
commit
76dd026447
@ -9,7 +9,7 @@
|
||||
import {NgZone} from '@angular/core';
|
||||
|
||||
import {ListWrapper} from './facade/collection';
|
||||
import {global, isPresent, isString} from './facade/lang';
|
||||
import {global, isPresent} from './facade/lang';
|
||||
import {getDOM} from './private_import_platform-browser';
|
||||
|
||||
export class BrowserDetection {
|
||||
@ -108,7 +108,7 @@ export function stringifyElement(el: any /** TODO #9100 */): string {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
var attValue = attributeMap.get(key);
|
||||
if (!isString(attValue)) {
|
||||
if (typeof attValue !== 'string') {
|
||||
result += ` ${key}`;
|
||||
} else {
|
||||
result += ` ${key}="${attValue}"`;
|
||||
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
|
||||
import {global, isString} from './facade/lang';
|
||||
import {global} from './facade/lang';
|
||||
import {getDOM} from './private_import_platform-browser';
|
||||
|
||||
|
||||
@ -187,7 +187,7 @@ _global.beforeEach(function() {
|
||||
return {
|
||||
compare: function(actual: any, styles: {[k: string]: string}|string) {
|
||||
let allPassed: boolean;
|
||||
if (isString(styles)) {
|
||||
if (typeof styles === 'string') {
|
||||
allPassed = getDOM().hasStyle(actual, styles);
|
||||
} else {
|
||||
allPassed = Object.keys(styles).length !== 0;
|
||||
@ -199,9 +199,9 @@ _global.beforeEach(function() {
|
||||
return {
|
||||
pass: allPassed,
|
||||
get message() {
|
||||
const expectedValueStr = isString(styles) ? styles : JSON.stringify(styles);
|
||||
const expectedValueStr = typeof styles === 'string' ? styles : JSON.stringify(styles);
|
||||
return `Expected ${actual.outerHTML} ${!allPassed ? ' ' : 'not '}to contain the
|
||||
CSS ${isString(styles) ? 'property' : 'styles'} "${expectedValueStr}"`;
|
||||
CSS ${typeof styles === 'string' ? 'property' : 'styles'} "${expectedValueStr}"`;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user