Skip to content

Commit d9fa204

Browse files
committed
Use deepEqual instead comparing JSON.
1 parent bc79c7c commit d9fa204

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/auth/src/core/auth/emulator.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Auth } from '../../model/public_types';
1818
import { AuthErrorCode } from '../errors';
1919
import { _assert } from '../util/assert';
2020
import { _castAuth } from './auth_impl';
21+
import { deepEqual } from '@firebase/util';
2122

2223
/**
2324
* Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production
@@ -70,10 +71,8 @@ export function connectAuthEmulator(
7071

7172
if (!authInternal._canInitEmulator) {
7273
_assert(
73-
JSON.stringify(emulator) ===
74-
JSON.stringify(authInternal.config.emulator) &&
75-
JSON.stringify(emulatorConfig) ===
76-
JSON.stringify(authInternal.emulatorConfig),
74+
deepEqual(emulator, authInternal.config.emulator || {}) &&
75+
deepEqual(emulatorConfig, authInternal.emulatorConfig || {}),
7776
authInternal,
7877
AuthErrorCode.EMULATOR_CONFIG_FAILED
7978
);

0 commit comments

Comments
 (0)