From c18404cdc3a71778baf22bc5eed57c8c3a237da9 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Wed, 10 Jan 2024 16:26:25 +0530 Subject: [PATCH 1/3] lower case a, the, and --- .github/scripts/createDocsRoutes.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/scripts/createDocsRoutes.js b/.github/scripts/createDocsRoutes.js index 6604a9d207fa..15bb555c3642 100644 --- a/.github/scripts/createDocsRoutes.js +++ b/.github/scripts/createDocsRoutes.js @@ -16,7 +16,12 @@ const platformNames = { * @returns {String} */ function toTitleCase(str) { - return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1)); + return str.split(' ').map((word, i) => { + if (i !== 0 && (word.toLowerCase() === 'a' || word.toLowerCase() === 'the' || word.toLowerCase() === 'and')) { + return word.toLowerCase(); + } + return word.charAt(0).toUpperCase() + word.substring(1); + }).join(' '); } /** From 3458059c5b3d8229218e27b526ff47d72f256ce7 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Wed, 10 Jan 2024 16:36:13 +0530 Subject: [PATCH 2/3] fix case --- .../getting-started/{Tips-And-Tricks.md => Tips-and-Tricks.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/articles/expensify-classic/getting-started/{Tips-And-Tricks.md => Tips-and-Tricks.md} (100%) diff --git a/docs/articles/expensify-classic/getting-started/Tips-And-Tricks.md b/docs/articles/expensify-classic/getting-started/Tips-and-Tricks.md similarity index 100% rename from docs/articles/expensify-classic/getting-started/Tips-And-Tricks.md rename to docs/articles/expensify-classic/getting-started/Tips-and-Tricks.md From 38c0c8c2ff651bd182879df9ca0adb1f9dbd95e9 Mon Sep 17 00:00:00 2001 From: Rushat Gabhane Date: Wed, 10 Jan 2024 16:54:27 +0530 Subject: [PATCH 3/3] fix lint --- .github/scripts/createDocsRoutes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/createDocsRoutes.js b/.github/scripts/createDocsRoutes.js index 15bb555c3642..7c9ac532850d 100644 --- a/.github/scripts/createDocsRoutes.js +++ b/.github/scripts/createDocsRoutes.js @@ -16,7 +16,7 @@ const platformNames = { * @returns {String} */ function toTitleCase(str) { - return str.split(' ').map((word, i) => { + return _.map(str.split(' '), (word, i) => { if (i !== 0 && (word.toLowerCase() === 'a' || word.toLowerCase() === 'the' || word.toLowerCase() === 'and')) { return word.toLowerCase(); }