From 1618249b5c3f7e1970472dddfeae661a7a4443cb Mon Sep 17 00:00:00 2001 From: Prince Mendiratta Date: Mon, 20 Feb 2023 18:20:02 +0530 Subject: [PATCH] verbose naming Signed-off-by: Prince Mendiratta --- src/CONST.js | 2 ++ src/libs/{polyfill => IntlPolyfill}/index.js | 4 ++-- src/libs/{polyfill => IntlPolyfill}/index.native.js | 2 +- .../intl-polyfill.js => IntlPolyfill/shouldPolyfill.js} | 0 src/setup/index.js | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) rename src/libs/{polyfill => IntlPolyfill}/index.js (84%) rename src/libs/{polyfill => IntlPolyfill}/index.native.js (92%) rename src/libs/{polyfill/intl-polyfill.js => IntlPolyfill/shouldPolyfill.js} (100%) diff --git a/src/CONST.js b/src/CONST.js index a920b745f948..e074abae932c 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -1175,6 +1175,8 @@ const CONST = { 'Zambia', 'Zimbabwe', ], + + // Values for checking if polyfill is required on a platform POLYFILL_TEST: { STYLE: 'currency', CURRENCY: 'XAF', diff --git a/src/libs/polyfill/index.js b/src/libs/IntlPolyfill/index.js similarity index 84% rename from src/libs/polyfill/index.js rename to src/libs/IntlPolyfill/index.js index 7b68f6ff1c7f..4b6a964645d8 100644 --- a/src/libs/polyfill/index.js +++ b/src/libs/IntlPolyfill/index.js @@ -1,10 +1,10 @@ -import shouldPolyfill from './intl-polyfill'; +import shouldPolyfill from './shouldPolyfill'; /** * Polyfill the Intl API if the ICU version is old. * This ensures that the currency data is consistent across platforms and browsers. */ -export default function polyfill() { +export default function intlPolyfill() { if (!shouldPolyfill()) { return; } diff --git a/src/libs/polyfill/index.native.js b/src/libs/IntlPolyfill/index.native.js similarity index 92% rename from src/libs/polyfill/index.native.js rename to src/libs/IntlPolyfill/index.native.js index 13eba6636d01..8deafb2280a2 100644 --- a/src/libs/polyfill/index.native.js +++ b/src/libs/IntlPolyfill/index.native.js @@ -1,4 +1,4 @@ -import shouldPolyfill from './intl-polyfill'; +import shouldPolyfill from './shouldPolyfill'; /** * Polyfill the Intl API, always performed for native devices. diff --git a/src/libs/polyfill/intl-polyfill.js b/src/libs/IntlPolyfill/shouldPolyfill.js similarity index 100% rename from src/libs/polyfill/intl-polyfill.js rename to src/libs/IntlPolyfill/shouldPolyfill.js diff --git a/src/setup/index.js b/src/setup/index.js index 2335cbff783f..b2fea9a98ad8 100644 --- a/src/setup/index.js +++ b/src/setup/index.js @@ -5,7 +5,7 @@ import CONST from '../CONST'; import platformSetup from './platformSetup'; import * as Metrics from '../libs/Metrics'; import * as Device from '../libs/actions/Device'; -import polyfill from '../libs/polyfill'; +import intlPolyfill from '../libs/IntlPolyfill'; export default function () { /* @@ -49,7 +49,7 @@ export default function () { I18nManager.forceRTL(false); // Polyfill the Intl API if locale data is not as expected - polyfill(); + intlPolyfill(); // Perform any other platform-specific setup platformSetup();