feat(core): Moving Renderer3 into @angular/core (#20855)
PR Close #20855
This commit is contained in:

committed by
Igor Minar

parent
bc66d27938
commit
0fa818b318
23
packages/core/src/render3/util.ts
Normal file
23
packages/core/src/render3/util.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google Inc. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
/**
|
||||
* Must use this method for CD (instead of === ) since NaN !== NaN
|
||||
*/
|
||||
export function isDifferent(a: any, b: any): boolean {
|
||||
// NaN is the only value that is not equal to itself so the first
|
||||
// test checks if both a and b are not NaN
|
||||
return !(a !== a && b !== b) && a !== b;
|
||||
}
|
||||
|
||||
export function stringify(value: any): string {
|
||||
if (typeof value == 'function') return value.name || value;
|
||||
if (typeof value == 'string') return value;
|
||||
if (value == null) return '';
|
||||
return '' + value;
|
||||
}
|
Reference in New Issue
Block a user