Skip to content

Remove usages of goog.isFunction #3205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/auth/src/args.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ fireauth.args.func = function(opt_name, opt_optional) {
name: opt_name || '',
typeLabel: 'a function',
optional: !!opt_optional,
validator: goog.isFunction
validator: x => typeof x === 'function'
};
};

Expand Down Expand Up @@ -564,7 +564,7 @@ fireauth.args.phoneInfoOptions = function(name, optional) {
fireauth.args.validateMultiFactorSession_ = function(session, type) {
return goog.isObject(session) && typeof session.type === 'string' &&
session.type === type &&
goog.isFunction(session.getRawSession);
typeof session.getRawSession === 'function';
};


Expand Down Expand Up @@ -613,7 +613,7 @@ fireauth.args.applicationVerifier = function(opt_optional) {
function(applicationVerifier) {
return !!(applicationVerifier &&
typeof applicationVerifier.type === 'string' &&
goog.isFunction(applicationVerifier.verify));
typeof applicationVerifier.verify === 'function');
})
});
};
Expand Down
8 changes: 4 additions & 4 deletions packages/auth/src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -1412,9 +1412,9 @@ fireauth.Auth.prototype.onIdTokenChanged = function(
// and different promises library and this leads to calls resolutions order
// being different from the promises registration order.
Promise.resolve().then(function() {
if (goog.isFunction(nextOrObserver)) {
if (typeof nextOrObserver === 'function') {
nextOrObserver(self.currentUser_());
} else if (goog.isFunction(nextOrObserver['next'])) {
} else if (typeof nextOrObserver['next'] === 'function') {
nextOrObserver['next'](self.currentUser_());
}
});
Expand Down Expand Up @@ -1458,9 +1458,9 @@ fireauth.Auth.prototype.onAuthStateChanged = function(
// it has the correct UID before triggering the user state change
// listeners.
self.userStateChangeUid_ = self.getUid();
if (goog.isFunction(nextOrObserver)) {
if (typeof nextOrObserver === 'function') {
nextOrObserver(self.currentUser_());
} else if (goog.isFunction(nextOrObserver['next'])) {
} else if (typeof nextOrObserver['next'] === 'function') {
nextOrObserver['next'](self.currentUser_());
}
});
Expand Down