summaryrefslogtreecommitdiff
path: root/node_modules/pretty-bytes/pretty-bytes.js
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 23:08:57 +0300
commit726b81b19251674e149ccfbb1abacbd837fc6db0 (patch)
treefbdbb227dc01357eb76e8222d76185bc124c5ca6 /node_modules/pretty-bytes/pretty-bytes.js
parent34f0890e175698940d49238097579f44e4d78c89 (diff)
downloadFlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.gz
FlashRunner-726b81b19251674e149ccfbb1abacbd837fc6db0.tar.zst
Removed files that should not have been included in git
Diffstat (limited to 'node_modules/pretty-bytes/pretty-bytes.js')
-rw-r--r--node_modules/pretty-bytes/pretty-bytes.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/node_modules/pretty-bytes/pretty-bytes.js b/node_modules/pretty-bytes/pretty-bytes.js
deleted file mode 100644
index 626c18a..0000000
--- a/node_modules/pretty-bytes/pretty-bytes.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*!
- pretty-bytes
- Convert bytes to a human readable string: 1337 → 1.34 kB
- https://github.com/sindresorhus/pretty-bytes
- by Sindre Sorhus
- MIT License
-*/
-(function () {
- 'use strict';
-
- // Number.isNaN() polyfill
- var isNaN = function (val) {
- return val !== val;
- };
-
- var prettyBytes = function (num) {
- if (typeof num !== 'number' || isNaN(num)) {
- throw new TypeError('Expected a number');
- }
-
- var exponent;
- var unit;
- var neg = num < 0;
- var units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
-
- if (neg) {
- num = -num;
- }
-
- if (num < 1) {
- return (neg ? '-' : '') + num + ' B';
- }
-
- exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1);
- num = (num / Math.pow(1000, exponent)).toFixed(2) * 1;
- unit = units[exponent];
-
- return (neg ? '-' : '') + num + ' ' + unit;
- };
-
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = prettyBytes;
- } else {
- self.prettyBytes = prettyBytes;
- }
-})();