pretty-bytes
Advanced tools
Comparing version 5.4.0 to 5.4.1
16
index.js
@@ -39,2 +39,14 @@ 'use strict'; | ||
const BIBIT_UNITS = [ | ||
'b', | ||
'kibit', | ||
'Mibit', | ||
'Gibit', | ||
'Tibit', | ||
'Pibit', | ||
'Eibit', | ||
'Zibit', | ||
'Yibit' | ||
]; | ||
/* | ||
@@ -63,3 +75,5 @@ Formats the given number using `Number#toLocaleString`. | ||
options = Object.assign({bits: false, binary: false}, options); | ||
const UNITS = options.bits ? (options.binary ? BIBYTE_UNITS : BIT_UNITS) : BYTE_UNITS; | ||
const UNITS = options.bits ? | ||
(options.binary ? BIBIT_UNITS : BIT_UNITS) : | ||
(options.binary ? BIBYTE_UNITS : BYTE_UNITS); | ||
@@ -66,0 +80,0 @@ if (options.signed && number === 0) { |
{ | ||
"name": "pretty-bytes", | ||
"version": "5.4.0", | ||
"version": "5.4.1", | ||
"description": "Convert bytes to a human readable string: 1337 → 1.34 kB", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
9029
150