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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user