aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-01-29 16:27:47 +0100
committerGitHub <[email protected]>2023-01-29 16:27:47 +0100
commit0bc6c2fbe65de9a9f706aa6f78f3b07940038461 (patch)
treef7d044507b74a38106760af9fc4d4938a21191d5 /scripts
parent6772b00cf19ccdbebefe023dc0f96c6576234b5b (diff)
downloadfaker-0bc6c2fbe65de9a9f706aa6f78f3b07940038461.tar.xz
faker-0bc6c2fbe65de9a9f706aa6f78f3b07940038461.zip
refactor(locale)!: remove unused separator entry (#1731)
Diffstat (limited to 'scripts')
-rw-r--r--scripts/generateLocales.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts
index 07cf47e7..ce7bce60 100644
--- a/scripts/generateLocales.ts
+++ b/scripts/generateLocales.ts
@@ -132,7 +132,7 @@ function tryLoadLocalesMainIndexFile(pathModules: string): LocaleDefinition {
let localeDef: LocaleDefinition;
// This call might fail, if the module setup is broken.
// Unfortunately, we try to fix it with this script
- // Thats why have a fallback logic here, we only need the title and separator anyway
+ // Thats why have a fallback logic here, we only need the title anyway
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
localeDef = require(pathModules).default;
@@ -147,7 +147,6 @@ function tryLoadLocalesMainIndexFile(pathModules: string): LocaleDefinition {
);
localeDef = {
title: localeIndex.match(/title: '(.*)',/)[1],
- separator: localeIndex.match(/separator: '(.*)',/)?.[1],
};
} catch {
console.error(`Failed to load ${pathModules} or manually parse it.`, e);
@@ -287,7 +286,6 @@ for (const locale of locales) {
const localeDef = tryLoadLocalesMainIndexFile(pathModules);
// We use a fallback here to at least generate a working file.
const localeTitle = localeDef?.title ?? `TODO: Insert Title for ${locale}`;
- const localeSeparator = localeDef?.separator;
localeIndexImports += `import ${locale} from './${locale}';\n`;
localeIndexType += ` | '${locale}'\n`;
@@ -298,14 +296,12 @@ for (const locale of locales) {
generateLocaleFile(locale);
// src/locales/**/index.ts
- const separator = localeSeparator ? `\nseparator: '${localeSeparator}',` : '';
-
generateRecursiveModuleIndexes(
pathModules,
locale,
'LocaleDefinition',
1,
- `title: '${localeTitle}',${separator}`
+ `title: '${localeTitle}',`
);
}