Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Convert numbers to strings
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Feb 28, 2020
1 parent 0cbf0f4 commit f44722f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staart/manager",
"version": "1.3.23",
"version": "1.3.24",
"main": "index.js",
"repository": "[email protected]:staart/api.git",
"author": "Anand Chowdhary <[email protected]>",
Expand Down Expand Up @@ -125,5 +125,5 @@
"setup"
],
"snyk": true,
"staart-version": "1.3.23"
"staart-version": "1.3.24"
}
5 changes: 3 additions & 2 deletions src/helpers/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const uncleanValues = (
data: (User | BackupCode | Email | Membership | Organization)[]
) => {
if (typeof data.map === "function") {
data.map((item: KeyValue) => {
data = data.map((item: KeyValue) => {
Object.keys(item).forEach(key => {
try {
if (jsonValues.includes(key)) item[key] = JSON.parse(item[key]);
Expand All @@ -92,6 +92,7 @@ export const uncleanValues = (
)
).toISOString();
}
if (typeof item[key] === "number") item[key] = String(item[key]);
if (typeof item[key] === "string") item[key] = emojify(item[key]);
});
return item;
Expand Down Expand Up @@ -157,7 +158,7 @@ export const addIsPrimaryToEmails = async (emails: Email[]) => {
const userPrimaryEmailObject = await getUserPrimaryEmailObject(
emails[0].userId
);
emails.map(email => {
emails = emails.map(email => {
email.isPrimary = email.id === userPrimaryEmailObject.id;
return email;
});
Expand Down

0 comments on commit f44722f

Please sign in to comment.