Skip to content

Commit

Permalink
🐛 Fix --with-arrays producing objects instead of arrays in output f…
Browse files Browse the repository at this point in the history
…iles
  • Loading branch information
leolabs committed Jan 11, 2024
1 parent d0096d8 commit bfb3723
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ const translate = async (
workingDir,
dirStructure,
deleteUnusedStrings,
withArrays,
);

switch (dirStructure) {
Expand Down Expand Up @@ -421,6 +422,7 @@ function createTranslator(
workingDir: string,
dirStructure: DirectoryStructure,
deleteUnusedStrings: boolean,
withArrays: boolean,
) {
return async (
sourceFile: TranslatableFile,
Expand Down Expand Up @@ -482,7 +484,7 @@ function createTranslator(
const newContent =
JSON.stringify(
sourceFile.type === 'key-based'
? unflatten(translatedFile, { object: true })
? unflatten(translatedFile, { object: !withArrays })
: translatedFile,
null,
2,
Expand Down

0 comments on commit bfb3723

Please sign in to comment.