when I am running this code then it prints the results but doesn't exit or completely and it prints the output correctly. here finalArray is the array of phone Numbers. and this is inside an async function and i have to used this inside an async function because I have to perform other queries.
const update = async() => {
const getAuth = async phoneNumber => {
return auth.getUserByPhoneNumber(phoneNumber).catch(() => {
return {
phoneNumber,
uid: null,
email: '',
displayName: '',
emailVerified,
disabled,
};
});
};
const creatorRecords = await Promise.all(
finalArray.map(phoneNumbercreator => {
return getAuth(phoneNumbercreator);
}),
);
}