nestjs-i18n
Advanced tools
Comparing version 2.2.1 to 2.2.2
@@ -11,3 +11,5 @@ import { Logger } from '@nestjs/common'; | ||
[k: string]: any; | ||
} | string>): any; | ||
} | string> | { | ||
[k: string]: any; | ||
}): any; | ||
} |
@@ -24,3 +24,3 @@ "use strict"; | ||
} | ||
translate(lang, key, args = []) { | ||
translate(lang, key, args) { | ||
let translation = this.translations[lang][key]; | ||
@@ -39,4 +39,4 @@ if (translation === undefined || translation === null) { | ||
} | ||
if (args && args.length > 0) { | ||
translation = format(translation, ...(args || [])); | ||
if (args || (args instanceof Array && args.length > 0)) { | ||
translation = format(translation, ...(args instanceof Array ? args || [] : [args])); | ||
} | ||
@@ -43,0 +43,0 @@ return translation; |
{ | ||
"name": "nestjs-i18n", | ||
"version": "2.2.1", | ||
"version": "2.2.2", | ||
"description": "", | ||
@@ -32,3 +32,3 @@ "author": "Toon van Strijp", | ||
"jest": "^24.8.0", | ||
"lint-staged": "9.0.0", | ||
"lint-staged": "9.0.2", | ||
"prettier": "1.18.2", | ||
@@ -35,0 +35,0 @@ "reflect-metadata": "^0.1.13", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15731
18
270