Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Starman3787 committed Oct 24, 2024
1 parent da47a9d commit 85b4c73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ export const getDatabaseLocaleCode = (language) => {
return toReturn;
};

export const getLocaleFromDatabaseCode = (databaseCode) => {
for (const [key, value] of Object.entries(locales))
if (value.id === databaseCode) return key;
throw new Error(`Language ${databaseCode} not found`);
};

const readObject = (obj, cursor = "") => {
if (!obj) return undefined;
const cursorPath = cursor.split(".");
Expand Down

0 comments on commit 85b4c73

Please sign in to comment.