@depup/pretty-bytes 7.1.0-depup.0 → 7.1.1-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/changes.json +5 -0
- package/index.js +13 -17
- package/package.json +12 -8
package/README.md
CHANGED
|
@@ -13,8 +13,8 @@ npm install @depup/pretty-bytes
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [pretty-bytes](https://www.npmjs.com/package/pretty-bytes) @ 7.1.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [pretty-bytes](https://www.npmjs.com/package/pretty-bytes) @ 7.1.1 |
|
|
17
|
+
| Processed | 2026-07-21 |
|
|
18
18
|
| Smoke test | passed |
|
|
19
19
|
| Deps updated | 0 |
|
|
20
20
|
|
package/changes.json
ADDED
package/index.js
CHANGED
|
@@ -155,24 +155,20 @@ export default function prettyBytes(number, options) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
const localeOptions = buildLocaleOptions(options);
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (number
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
number = number.toPrecision(minPrecision);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
const numberString = toLocaleString(Number(number), options.locale, localeOptions);
|
|
173
|
-
const unit = UNITS[exponent];
|
|
174
|
-
result = prefix + numberString + separator + unit;
|
|
158
|
+
|
|
159
|
+
let exponent = 0;
|
|
160
|
+
if (number >= 1) {
|
|
161
|
+
exponent = Math.min(Math.floor(options.binary ? log(number) / Math.log(1024) : log10(number) / 3), UNITS.length - 1);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
number = divide(number, (options.binary ? 1024 : 1000) ** exponent);
|
|
165
|
+
|
|
166
|
+
if (!localeOptions) {
|
|
167
|
+
const minPrecision = Math.max(3, Math.floor(number).toString().length);
|
|
168
|
+
number = Number(number.toPrecision(minPrecision));
|
|
175
169
|
}
|
|
176
170
|
|
|
171
|
+
const numberString = toLocaleString(number, options.locale, localeOptions);
|
|
172
|
+
const result = prefix + numberString + separator + UNITS[exponent];
|
|
177
173
|
return applyFixedWidth(result, options.fixedWidth);
|
|
178
174
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/pretty-bytes",
|
|
3
|
-
"version": "7.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.1.1-depup.0",
|
|
4
|
+
"description": "Convert bytes to a human readable string: 1337 → 1.34 kB (with updated dependencies)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "sindresorhus/pretty-bytes",
|
|
7
7
|
"funding": "https://github.com/sponsors/sindresorhus",
|
|
@@ -24,13 +24,17 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"index.js",
|
|
27
|
-
"index.d.ts"
|
|
27
|
+
"index.d.ts",
|
|
28
|
+
"changes.json",
|
|
29
|
+
"README.md"
|
|
28
30
|
],
|
|
29
31
|
"keywords": [
|
|
30
|
-
"depup",
|
|
31
|
-
"dependency-bumped",
|
|
32
|
-
"updated-deps",
|
|
33
32
|
"pretty-bytes",
|
|
33
|
+
"depup",
|
|
34
|
+
"updated-dependencies",
|
|
35
|
+
"security",
|
|
36
|
+
"latest",
|
|
37
|
+
"patched",
|
|
34
38
|
"pretty",
|
|
35
39
|
"bytes",
|
|
36
40
|
"byte",
|
|
@@ -55,8 +59,8 @@
|
|
|
55
59
|
"changes": {},
|
|
56
60
|
"depsUpdated": 0,
|
|
57
61
|
"originalPackage": "pretty-bytes",
|
|
58
|
-
"originalVersion": "7.1.
|
|
59
|
-
"processedAt": "2026-
|
|
62
|
+
"originalVersion": "7.1.1",
|
|
63
|
+
"processedAt": "2026-07-21T17:29:59.339Z",
|
|
60
64
|
"smokeTest": "passed"
|
|
61
65
|
}
|
|
62
66
|
}
|