Created
June 6, 2016 15:11
-
-
Save douglascorrea/003ae6a6b11f19c97d6ee5b28d0d9eef to your computer and use it in GitHub Desktop.
transformFirebaseUser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function transformFirebaseUser(firebaseUser) { | |
const storeUser = {}; | |
const userProperties = [ | |
'displayName', | |
'email', | |
'emailVerified', | |
'isAnonymous', | |
'photoURL', | |
'providerData', | |
'providerId', | |
'refreshToken', | |
'uid', | |
'isAdmin' | |
]; | |
userProperties.map((prop) => { | |
if (prop in firebaseUser) { | |
storeUser[prop] = firebaseUser[prop]; | |
} | |
}); | |
return storeUser; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Cool, thanks!