svelte-common 6.19.36 → 6.19.37
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/package.json +2 -2
- package/src/components/Duration.svelte +1 -2
- package/src/index.svelte +0 -1
- package/src/util.mjs +0 -27
- package/types/util.d.mts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-common",
|
|
3
|
-
"version": "6.19.
|
|
3
|
+
"version": "6.19.37",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"preview": "vite preview"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"pacc": "^6.
|
|
52
|
+
"pacc": "^6.3.0",
|
|
53
53
|
"svelte-command": "^3.0.47",
|
|
54
54
|
"svelte-entitlement": "^2.0.55"
|
|
55
55
|
},
|
package/src/index.svelte
CHANGED
package/src/util.mjs
CHANGED
|
@@ -24,33 +24,6 @@ export function formatBytes(bytes, decimals = 2) {
|
|
|
24
24
|
|
|
25
25
|
const byteSizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
26
26
|
|
|
27
|
-
const durationsISO = [
|
|
28
|
-
[86400, "D"],
|
|
29
|
-
[3600, "H"],
|
|
30
|
-
[60, "M"],
|
|
31
|
-
[1, "S"]
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
export function formatDurationISO(seconds) {
|
|
35
|
-
let out = "P";
|
|
36
|
-
let t = false;
|
|
37
|
-
|
|
38
|
-
for (const d of durationsISO) {
|
|
39
|
-
if (seconds < 86400 && !t) {
|
|
40
|
-
out += "T";
|
|
41
|
-
t = true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const n = Math.floor(seconds / Number(d[0]));
|
|
45
|
-
if (n > 0) {
|
|
46
|
-
out += `${n}${d[1]}`;
|
|
47
|
-
seconds -= n * Number(d[0]);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return out;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
27
|
export function formatSecondsSinceEpoch(sse) {
|
|
55
28
|
if (sse === undefined) {
|
|
56
29
|
return "-";
|
package/types/util.d.mts
CHANGED