Skip to content

Commit 6f266bf

Browse files
authored
Remove usages of goog.isFunction (#3205)
* Update args.js * Update auth.js
1 parent 417dd7c commit 6f266bf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/auth/src/args.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ fireauth.args.func = function(opt_name, opt_optional) {
307307
name: opt_name || '',
308308
typeLabel: 'a function',
309309
optional: !!opt_optional,
310-
validator: goog.isFunction
310+
validator: x => typeof x === 'function'
311311
};
312312
};
313313

@@ -564,7 +564,7 @@ fireauth.args.phoneInfoOptions = function(name, optional) {
564564
fireauth.args.validateMultiFactorSession_ = function(session, type) {
565565
return goog.isObject(session) && typeof session.type === 'string' &&
566566
session.type === type &&
567-
goog.isFunction(session.getRawSession);
567+
typeof session.getRawSession === 'function';
568568
};
569569

570570

@@ -613,7 +613,7 @@ fireauth.args.applicationVerifier = function(opt_optional) {
613613
function(applicationVerifier) {
614614
return !!(applicationVerifier &&
615615
typeof applicationVerifier.type === 'string' &&
616-
goog.isFunction(applicationVerifier.verify));
616+
typeof applicationVerifier.verify === 'function');
617617
})
618618
});
619619
};

packages/auth/src/auth.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1412,9 +1412,9 @@ fireauth.Auth.prototype.onIdTokenChanged = function(
14121412
// and different promises library and this leads to calls resolutions order
14131413
// being different from the promises registration order.
14141414
Promise.resolve().then(function() {
1415-
if (goog.isFunction(nextOrObserver)) {
1415+
if (typeof nextOrObserver === 'function') {
14161416
nextOrObserver(self.currentUser_());
1417-
} else if (goog.isFunction(nextOrObserver['next'])) {
1417+
} else if (typeof nextOrObserver['next'] === 'function') {
14181418
nextOrObserver['next'](self.currentUser_());
14191419
}
14201420
});
@@ -1458,9 +1458,9 @@ fireauth.Auth.prototype.onAuthStateChanged = function(
14581458
// it has the correct UID before triggering the user state change
14591459
// listeners.
14601460
self.userStateChangeUid_ = self.getUid();
1461-
if (goog.isFunction(nextOrObserver)) {
1461+
if (typeof nextOrObserver === 'function') {
14621462
nextOrObserver(self.currentUser_());
1463-
} else if (goog.isFunction(nextOrObserver['next'])) {
1463+
} else if (typeof nextOrObserver['next'] === 'function') {
14641464
nextOrObserver['next'](self.currentUser_());
14651465
}
14661466
});

0 commit comments

Comments
 (0)