Use empty array instead of empty string

Documentation says to pass `undefined` or an array. 
An empty string is not supported upon closer inspection.
Recommended not to pass `undefined` as it might cause weird quirks.
People recommend using empty array.
This commit is contained in:
Helcostr
2021-05-10 14:50:57 -07:00
committed by GitHub
parent 2636f46a1a
commit 14c4a4f50c
+1 -1
View File
@@ -12,7 +12,7 @@ export default function localizeNumber (valIn, lang, optIn) {
return val.toLocaleString(
// Catch null just incase
(lang || '')
(lang || [])
// Strip beyond @ symbol to allow custom languages
.replace(/@(?:.+)$/, '')
// We use underscore, this mthd uses dash