refactor(facade): Inline isBlank called with object-type argument (#11992)
This commit is contained in:

committed by
Chuck Jazdzewski

parent
a4af1561b7
commit
b39d3a173e
@ -6,7 +6,7 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {isBlank} from '../../src/facade/lang';
|
||||
|
||||
|
||||
export function iterableChangesAsString(
|
||||
{collection = [] as any, previous = [] as any, additions = [] as any, moves = [] as any,
|
||||
@ -23,11 +23,11 @@ export function kvChangesAsString(
|
||||
{map, previous, additions, changes, removals}:
|
||||
{map?: any[], previous?: any[], additions?: any[], changes?: any[], removals?: any[]}):
|
||||
string {
|
||||
if (isBlank(map)) map = [];
|
||||
if (isBlank(previous)) previous = [];
|
||||
if (isBlank(additions)) additions = [];
|
||||
if (isBlank(changes)) changes = [];
|
||||
if (isBlank(removals)) removals = [];
|
||||
if (!map) map = [];
|
||||
if (!previous) previous = [];
|
||||
if (!additions) additions = [];
|
||||
if (!changes) changes = [];
|
||||
if (!removals) removals = [];
|
||||
|
||||
return 'map: ' + map.join(', ') + '\n' +
|
||||
'previous: ' + previous.join(', ') + '\n' +
|
||||
|
@ -11,7 +11,7 @@ import {ReflectiveInjectorDynamicStrategy, ReflectiveInjectorInlineStrategy, Ref
|
||||
import {ResolvedReflectiveProvider_} from '@angular/core/src/di/reflective_provider';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
|
||||
import {isBlank, isPresent, stringify} from '../../src/facade/lang';
|
||||
import {isPresent, stringify} from '../../src/facade/lang';
|
||||
|
||||
class Engine {}
|
||||
|
||||
@ -458,7 +458,7 @@ export function main() {
|
||||
it('should resolve and flatten', () => {
|
||||
var providers = ReflectiveInjector.resolve([Engine, [BrokenEngine]]);
|
||||
providers.forEach(function(b) {
|
||||
if (isBlank(b)) return; // the result is a sparse array
|
||||
if (!b) return; // the result is a sparse array
|
||||
expect(b instanceof ResolvedReflectiveProvider_).toBe(true);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user