From ac6a69ac286bceb61abcda83413c692095515c45 Mon Sep 17 00:00:00 2001 From: Orim Dominic Adah Date: Sun, 3 Apr 2022 04:10:40 +0100 Subject: [PATCH 1/3] fix: replaceAll undefined Related issue: [Getting TypeError when installing Ramadan CLI](https://github.com/ahmadawais/ramadan-cli/issues/13) --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0051e62..76af3f9 100755 --- a/index.js +++ b/index.js @@ -14,8 +14,9 @@ const {school, all} = cli.flags; init(); input === 'help' && (await cli.showHelp(0)); !input && (await cli.showHelp(0)); - - const city = input.toLowerCase().replaceAll(' ', '-').trim(); + + // replace all spaces with a - character + const city = input.toLowerCase().replace(/\s/g, "-").trim(); // → Set first ramazan date b3low. await print({city, school, all, firstRozaDateISO: `2022-04-03`}); From 27a5e91c7e14c81d823763d26a1f8e887cdaa9ca Mon Sep 17 00:00:00 2001 From: Orim Dominic Adah Date: Sun, 3 Apr 2022 04:17:01 +0100 Subject: [PATCH 2/3] fix: replaceAll undefined --- utils/theEnd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/theEnd.js b/utils/theEnd.js index 1aedbbc..e708015 100644 --- a/utils/theEnd.js +++ b/utils/theEnd.js @@ -4,7 +4,7 @@ const {dim} = require('chalk'); module.exports = async ({city}) => { const cityNiceName = `${city.charAt(0).toUpperCase()}${city .slice(1) - .replaceAll('-', ' ')}`; + ..replace(/\s/g, "-")}`; // replace all spaces with a - character console.log( dim( From dba12a404300555e2bd88919a42059497058924f Mon Sep 17 00:00:00 2001 From: Orim Dominic Adah Date: Sun, 3 Apr 2022 04:17:21 +0100 Subject: [PATCH 3/3] Update theEnd.js --- utils/theEnd.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/theEnd.js b/utils/theEnd.js index e708015..f69e633 100644 --- a/utils/theEnd.js +++ b/utils/theEnd.js @@ -4,7 +4,7 @@ const {dim} = require('chalk'); module.exports = async ({city}) => { const cityNiceName = `${city.charAt(0).toUpperCase()}${city .slice(1) - ..replace(/\s/g, "-")}`; // replace all spaces with a - character + .replace(/\s/g, "-")}`; // replace all spaces with a - character console.log( dim(