Skip to content

Commit

Permalink
fixing a path finding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jul 16, 2021
1 parent e07a941 commit e22e5a4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cityssm/unleet",
"version": "2.3.0",
"version": "2.3.1",
"description": "Removes symbols and character combinations from a text string, and replaces them with the letters they commonly represent.",
"type": "module",
"exports": "./index.js",
Expand Down
4 changes: 3 additions & 1 deletion translations.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as fs from "fs";
const translations = JSON.parse(fs.readFileSync("translations.json").toString());
import { fileURLToPath } from "url";
const translationsPath = fileURLToPath(new URL("translations.json", import.meta.url));
const translations = JSON.parse(fs.readFileSync(translationsPath).toString());
export const simpleTranslations = translations.simpleTranslations;
export const complexTranslations = translations.complexTranslations;
export const translationSymbols = [...Object.keys(simpleTranslations), ...Object.keys(complexTranslations)];
5 changes: 4 additions & 1 deletion translations.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import * as fs from "fs";
import { fileURLToPath } from "url";

type Translations = { [symbol: string]: string[] };

const translations = JSON.parse(fs.readFileSync("translations.json").toString());
const translationsPath = fileURLToPath(new URL("translations.json", import.meta.url));

const translations = JSON.parse(fs.readFileSync(translationsPath).toString());

export const simpleTranslations: Translations = translations.simpleTranslations;
export const complexTranslations: Translations = translations.complexTranslations;
Expand Down

0 comments on commit e22e5a4

Please sign in to comment.