diff --git a/src/factory.ts b/src/factory.ts index b47d686..3b9c3ad 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -151,11 +151,15 @@ async function getModelFolderContents(model: string): Promise }) ); + const l10nBundle: PartitionedBundle["l10nBundle"] = Object.assign( + {}, + ...L10N_FilesListByFolder + .map((folder, index) => ({ [l10nFolders[index]]: folder })) + ); + return { bundle: bundleMap, - l10nBundle: Object.assign({}, ...L10N_FilesListByFolder - .map((folder, index) => ({ [l10nFolders[index]]: folder })) - ) as PartitionedBundle["l10nBundle"] + l10nBundle }; } @@ -190,11 +194,11 @@ function getModelBufferContents(model: BundleUnit): PartitionedBundle { ) ); - const unLocalizedBundle = Object.assign({}, + const unLocalizedBundle: BundleUnit = Object.assign({}, ...bundleKeys .filter(file => !file.includes(".lproj")) .map(file => ({ [file]: bundle[file] })) - ) as BundleUnit; + ); return { bundle: unLocalizedBundle,