svelte-common 6.19.36 → 6.19.38

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.36",
3
+ "version": "6.19.38",
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.0",
52
+ "pacc": "^6.2.1",
53
53
  "svelte-command": "^3.0.47",
54
54
  "svelte-entitlement": "^2.0.55"
55
55
  },
@@ -1,6 +1,5 @@
1
1
  <script>
2
- import { formatDurationISO } from "../util.mjs";
3
- import { formatDuration } from "pacc";
2
+ import { formatDuration, formatDurationISO } from "pacc";
4
3
  let { seconds } = $props();
5
4
  </script>
6
5
 
package/src/index.svelte CHANGED
@@ -40,7 +40,6 @@
40
40
  export {
41
41
  dateFormatter,
42
42
  formatBytes,
43
- formatDurationISO,
44
43
  formatSecondsSinceEpoch,
45
44
  keyPrefixStore
46
45
  } from "./util.mjs";
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
@@ -1,5 +1,4 @@
1
1
  export function formatBytes(bytes: any, decimals?: number): string;
2
- export function formatDurationISO(seconds: any): string;
3
2
  export function formatSecondsSinceEpoch(sse: any): string;
4
3
  /**
5
4
  * Create a derived store where all the object keys are prefixed.