diff options
| author | ST-DDT <[email protected]> | 2023-04-23 21:12:31 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-23 21:12:31 +0200 |
| commit | 4ca3b75c21cb795bb791335b4a316f435b3dab7f (patch) | |
| tree | 1eedc4792e4034ad8d92bb029cbc04efe9205543 | |
| parent | 8a0bbf5faa03c294d308a13fe210ba6aaeef6968 (diff) | |
| download | faker-4ca3b75c21cb795bb791335b4a316f435b3dab7f.tar.xz faker-4ca3b75c21cb795bb791335b4a316f435b3dab7f.zip | |
fix: script error (#2085)
| -rw-r--r-- | scripts/generateLocales.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/generateLocales.ts b/scripts/generateLocales.ts index f92bc508..4baa5846 100644 --- a/scripts/generateLocales.ts +++ b/scripts/generateLocales.ts @@ -282,10 +282,12 @@ for (const locale of locales) { try { // eslint-disable-next-line @typescript-eslint/no-var-requires const metadata: MetadataDefinitions = require(pathMetadata).default; - localeTitle = metadata.title; - if (!localeTitle) { + const { title } = metadata; + if (!title) { throw new Error(`No title property found on ${JSON.stringify(metadata)}`); } + + localeTitle = title; } catch (e) { console.error( `Failed to load ${pathMetadata}. Please make sure the file exists and exports MetadataDefinitions.` |
