Last change
on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
3.2 KB
|
Line | |
---|
1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { areIterablesEqual, isListLikeIterable } from './iterable';
|
---|
9 | export function devModeEqual(a, b) {
|
---|
10 | const isListLikeIterableA = isListLikeIterable(a);
|
---|
11 | const isListLikeIterableB = isListLikeIterable(b);
|
---|
12 | if (isListLikeIterableA && isListLikeIterableB) {
|
---|
13 | return areIterablesEqual(a, b, devModeEqual);
|
---|
14 | }
|
---|
15 | else {
|
---|
16 | const isAObject = a && (typeof a === 'object' || typeof a === 'function');
|
---|
17 | const isBObject = b && (typeof b === 'object' || typeof b === 'function');
|
---|
18 | if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
|
---|
19 | return true;
|
---|
20 | }
|
---|
21 | else {
|
---|
22 | return Object.is(a, b);
|
---|
23 | }
|
---|
24 | }
|
---|
25 | }
|
---|
26 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGFyaXNvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc3JjL3V0aWwvY29tcGFyaXNvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFFSCxPQUFPLEVBQUMsaUJBQWlCLEVBQUUsa0JBQWtCLEVBQUMsTUFBTSxZQUFZLENBQUM7QUFFakUsTUFBTSxVQUFVLFlBQVksQ0FBQyxDQUFNLEVBQUUsQ0FBTTtJQUN6QyxNQUFNLG1CQUFtQixHQUFHLGtCQUFrQix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