@@ -20,7 +20,7 @@ Formats the given number using \`Number#toLocaleString\`.
20
20
const toLocaleString = (number, locale) => {
21
21
let result = number ;
22
22
23
- if (typeof locale === ' string' ) {
23
+ if (typeof locale === ' string' || Array . isArray ( locale ) ) {
24
24
result = number.toLocaleString(locale );
25
25
} else if (locale === true ) {
26
26
result = number.toLocaleString();
@@ -41,7 +41,7 @@ var prettyBytes = (number, options) => {
41
41
const UNITS = options .bits ? options .binary ? BIBIT_UNITS : BIT_UNITS : options .binary ? BIBYTE_UNITS : BYTE_UNITS ;
42
42
43
43
if (options .signed && number === 0 ) {
44
- return ' 0 ' + UNITS[0];
44
+ return \` 0 \${ UNITS[0]}\ ` ;
45
45
}
46
46
47
47
const isNegative = number < 0;
@@ -89,7 +89,7 @@ Formats the given number using \`Number#toLocaleString\`.
89
89
const toLocaleString = (number, locale) => {
90
90
let result = number ;
91
91
92
- if (typeof locale === ' string' ) {
92
+ if (typeof locale === ' string' || Array . isArray ( locale ) ) {
93
93
result = number.toLocaleString(locale );
94
94
} else if (locale === true ) {
95
95
result = number.toLocaleString();
@@ -110,7 +110,7 @@ var prettyBytes = (number, options) => {
110
110
const UNITS = options .bits ? options .binary ? BIBIT_UNITS : BIT_UNITS : options .binary ? BIBYTE_UNITS : BYTE_UNITS ;
111
111
112
112
if (options .signed && number === 0 ) {
113
- return ' 0 ' + UNITS[0];
113
+ return \` 0 \${ UNITS[0]}\ ` ;
114
114
}
115
115
116
116
const isNegative = number < 0;
@@ -164,7 +164,7 @@ exports[`Publish Test File via Babel: umd 1`] = `
164
164
const toLocaleString = (number , locale ) => {
165
165
let result = number ;
166
166
167
- if (typeof locale === ' string' ) {
167
+ if (typeof locale === ' string' || Array . isArray ( locale ) ) {
168
168
result = number .toLocaleString (locale );
169
169
} else if (locale === true ) {
170
170
result = number .toLocaleString ();
@@ -185,7 +185,7 @@ exports[`Publish Test File via Babel: umd 1`] = `
185
185
const UNITS = options.bits ? options.binary ? BIBIT_UNITS : BIT_UNITS : options.binary ? BIBYTE_UNITS : BYTE_UNITS;
186
186
187
187
if (options.signed && number === 0) {
188
- return ' 0 ' + UNITS [0 ];
188
+ return \ ` 0 \$ { UNITS [0 ]} \` ;
189
189
}
190
190
191
191
const isNegative = number < 0;
0 commit comments