svelte-common 6.19.39 → 6.19.40

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-common",
3
- "version": "6.19.39",
3
+ "version": "6.19.40",
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.2.1",
52
+ "pacc": "^6.5.0",
53
53
  "svelte-command": "^3.0.48",
54
54
  "svelte-entitlement": "^2.0.56"
55
55
  },
@@ -73,7 +73,7 @@
73
73
  "stylelint-config-standard": "^39.0.1",
74
74
  "svelte": "^5.46.0",
75
75
  "typescript": "^5.9.3",
76
- "vite": "^7.2.7",
76
+ "vite": "^7.3.0",
77
77
  "vite-plugin-compression2": "^2.4.0"
78
78
  },
79
79
  "peerDependencies": {
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import { formatBytes } from "../util.mjs";
2
+ import { formatBytes } from "pacc";
3
3
  let { value } = $props();
4
4
  </script>
5
5
 
package/src/index.svelte CHANGED
@@ -39,7 +39,6 @@
39
39
 
40
40
  export {
41
41
  dateFormatter,
42
- formatBytes,
43
42
  formatSecondsSinceEpoch,
44
43
  keyPrefixStore
45
44
  } from "./util.mjs";
package/src/util.mjs CHANGED
@@ -10,20 +10,6 @@ export const dateFormatter = new Intl.DateTimeFormat("default", {
10
10
  second: "2-digit"
11
11
  });
12
12
 
13
- export function formatBytes(bytes, decimals = 2) {
14
- if (bytes === 0) return "0 Bytes";
15
- if (bytes === 1) return "1 Byte";
16
-
17
- const k = 1024;
18
- const i = Math.floor(Math.log(bytes) / Math.log(k));
19
-
20
- return (
21
- parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)) + " " + byteSizes[i]
22
- );
23
- }
24
-
25
- const byteSizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
26
-
27
13
  export function formatSecondsSinceEpoch(sse) {
28
14
  if (sse === undefined) {
29
15
  return "-";
package/types/util.d.mts CHANGED
@@ -1,4 +1,3 @@
1
- export function formatBytes(bytes: any, decimals?: number): string;
2
1
  export function formatSecondsSinceEpoch(sse: any): string;
3
2
  /**
4
3
  * Create a derived store where all the object keys are prefixed.