(user: any)
| 70 | } |
| 71 | |
| 72 | function transUserToArray(user: any): any[] { |
| 73 | const arrLength = Math.max(...PROVIDER_ID_INDEX_MAP.values()) + 4; |
| 74 | const arr = Array(arrLength).fill(""); |
| 75 | arr[0] = user.localId; |
| 76 | arr[1] = user.email || ""; |
| 77 | arr[2] = user.emailVerified || false; |
| 78 | arr[3] = convertToNormalBase64(user.passwordHash || ""); |
| 79 | arr[4] = convertToNormalBase64(user.salt || ""); |
| 80 | arr[5] = escapeCsv(user.displayName || ""); |
| 81 | arr[6] = user.photoUrl || ""; |
| 82 | for (let i = 0; i < (!user.providerUserInfo ? 0 : user.providerUserInfo.length); i++) { |
| 83 | const providerInfo = user.providerUserInfo[i]; |
| 84 | if (providerInfo) { |
| 85 | const providerIndex = PROVIDER_ID_INDEX_MAP.get(providerInfo.providerId); |
| 86 | if (providerIndex) { |
| 87 | addProviderUserInfo(providerInfo, arr, providerIndex); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | arr[23] = user.createdAt; |
| 92 | arr[24] = user.lastLoginAt; |
| 93 | arr[25] = user.phoneNumber; |
| 94 | arr[26] = user.disabled; |
| 95 | // quote entire custom claims object and escape inner quotes with quotes |
| 96 | arr[27] = user.customAttributes |
| 97 | ? `"${user.customAttributes.replace(/(?<!\\)"/g, '""')}"` |
| 98 | : user.customAttributes; |
| 99 | return arr; |
| 100 | } |
| 101 | |
| 102 | function transUserJson(user: any): any { |
| 103 | const newUser: any = {}; |
no test coverage detected
searching dependent graphs…