MCPcopy Create free account
hub / github.com/firebase/firebase-tools / createWriteUsersToFile

Function createWriteUsersToFile

src/accountExporter.ts:158–179  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156}
157
158function createWriteUsersToFile(): (
159 userList: any[],
160 format: "csv" | "json",
161 writeStream: Writable,
162) => void {
163 let jsonSep = "";
164 return (userList: any[], format: "csv" | "json", writeStream: Writable) => {
165 userList.map((user) => {
166 if (user.passwordHash && user.version !== 0) {
167 // Password isn't hashed by default Scrypt.
168 delete user.passwordHash;
169 delete user.salt;
170 }
171 if (format === "csv") {
172 writeStream.write(transUserToArray(user).join(",") + "," + os.EOL, "utf8");
173 } else {
174 writeStream.write(jsonSep + JSON.stringify(transUserJson(user), null, 2), "utf8");
175 jsonSep = "," + os.EOL;
176 }
177 });
178 };
179}
180
181export async function serialExportUsers(projectId: string, options: any): Promise<any> {
182 if (!options.writeUsersToFile) {

Callers 1

serialExportUsersFunction · 0.85

Calls 3

transUserToArrayFunction · 0.85
transUserJsonFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…