From 150fd9099a13a6ca00603b57376cd6f673987b9c Mon Sep 17 00:00:00 2001 From: Nourman Hajar Date: Fri, 4 Sep 2020 19:17:58 +0700 Subject: [PATCH] Fix charlist path resolving problem --- index.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 80d5467..0c1aefe 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,15 @@ "use strict" +// Compatibility issues const matchAll = require("string.prototype.matchall"); -const path = require("path"); -const {NGLEGENA, SWARA, PASANGAN, SANDHANGAN, PADA, ANGKA} = require(path.join(__dirname, "charlist.js")); +const { + NGLEGENA, + SWARA, + PASANGAN, + SANDHANGAN, + PADA, + ANGKA +} = require("./charlist.js"); const getInitial = (glyph) => { if (glyph == null) @@ -305,7 +312,7 @@ const doTrans = (current, residue, input, isLast = true) => { return output(); }; -exports.toCarakan = (value, useDiacritics = false, useSwaraMurda = true) => { +export const toCarakan = (value, useDiacritics = false, useSwaraMurda = true) => { if (typeof value !== "string") throw new TypeError("Expected a string");