Skip to content

Commit

Permalink
making useSingleFile optional
Browse files Browse the repository at this point in the history
  • Loading branch information
rawand-faraidun committed Dec 9, 2023
1 parent 3cbff79 commit e05aaba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"$comment": "determines indentation of output translations files"
}
},
"required": ["localesPath", "locales", "defaultLocale", "useSingleFile"]
"required": ["localesPath", "locales", "defaultLocale"]
}
6 changes: 2 additions & 4 deletions lib/linguifyValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ export const linguifyValidation = () => {
}

// checking useSingleFile
if (typeof config.useSingleFile == 'undefined') {
throw new Error(chalk.yellow(`Linguify config file misses 'useSingleFile' key, please add it before starting`))
}
if (typeof config.useSingleFile != 'boolean') {
// can be undefined, but must be boolean
if (typeof config.useSingleFile != 'undefined' && typeof config.useSingleFile != 'boolean') {
throw new Error(chalk.yellow(`Provided 'useSingleFile' is not boolean, please change it before starting`))
}

Expand Down

0 comments on commit e05aaba

Please sign in to comment.