Skip to content

Commit

Permalink
Fix check for empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszGrajdek committed Nov 5, 2023
1 parent 1a569e4 commit 30359af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libs/Localize/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ function translateLocal<TKey extends TranslationPaths>(phrase: TKey, ...variable
/**
* Return translated string for given error.
*/
function translateIfPhraseKey(message: string | [string, Record<string, unknown> & {isTranslated?: true}]): string {
if (!message || (Array.isArray(message) && message.length > 0)) {
function translateIfPhraseKey(message: string | [string, Record<string, unknown> & {isTranslated?: true}] | []): string {
if (!message || (Array.isArray(message) && message.length === 0)) {
return '';
}

Expand Down

0 comments on commit 30359af

Please sign in to comment.