@bgord/bun 0.23.2 → 0.23.3

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": "@bgord/bun",
3
- "version": "0.23.2",
3
+ "version": "0.23.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -34,12 +34,12 @@
34
34
  "only-allow": "1.2.1",
35
35
  "shellcheck": "4.1.0",
36
36
  "typescript": "5.9.2",
37
- "zod": "4.1.3"
37
+ "zod": "4.1.4"
38
38
  },
39
39
  "dependencies": {
40
40
  "@axiomhq/winston": "1.3.1",
41
- "@bgord/tools": "0.12.18",
42
- "@hono/ua-blocker": "0.1.8",
41
+ "@bgord/tools": "0.12.19",
42
+ "@hono/ua-blocker": "0.1.9",
43
43
  "better-auth": "1.3.7",
44
44
  "check-disk-space": "3.4.0",
45
45
  "croner": "9.1.0",
@@ -55,6 +55,6 @@
55
55
  "yazl": "3.3.1"
56
56
  },
57
57
  "peerDependencies": {
58
- "zod": "4.1.3"
58
+ "zod": "4.1.4"
59
59
  }
60
60
  }
@@ -3,6 +3,11 @@ import type { FileHashPort } from "./file-hash.port";
3
3
 
4
4
  export class FileHashNoopAdapter implements FileHashPort {
5
5
  async hash(_path: tools.FilePathAbsolute | tools.FilePathRelative) {
6
- return { etag: "noop", size: tools.Size.fromBytes(0), lastModified: tools.Timestamp.parse(1000) };
6
+ return {
7
+ etag: "noop",
8
+ size: tools.Size.fromBytes(10),
9
+ lastModified: tools.Timestamp.parse(1000),
10
+ mime: new tools.Mime("text/plain"),
11
+ };
7
12
  }
8
13
  }
@@ -4,6 +4,7 @@ import type { FileHashPort } from "./file-hash.port";
4
4
  export class FileHashSha256BunAdapter implements FileHashPort {
5
5
  async hash(path: tools.FilePathAbsolute | tools.FilePathRelative) {
6
6
  const file = Bun.file(path.get());
7
+ const extension = path.getFilename().getExtension();
7
8
 
8
9
  const arrayBuffer = await file.arrayBuffer();
9
10
  const digest = await crypto.subtle.digest("SHA-256", arrayBuffer);
@@ -13,6 +14,7 @@ export class FileHashSha256BunAdapter implements FileHashPort {
13
14
  etag,
14
15
  size: tools.Size.fromBytes(arrayBuffer.byteLength),
15
16
  lastModified: tools.Timestamp.parse(file.lastModified),
17
+ mime: tools.Mime.fromExtension(extension),
16
18
  };
17
19
  }
18
20
  }
@@ -1,6 +1,11 @@
1
1
  import type * as tools from "@bgord/tools";
2
2
 
3
- export type FileHashResult = { etag: string; size: tools.Size; lastModified: tools.TimestampType };
3
+ export type FileHashResult = {
4
+ etag: string;
5
+ size: tools.Size;
6
+ lastModified: tools.TimestampType;
7
+ mime: tools.Mime;
8
+ };
4
9
 
5
10
  export interface FileHashPort {
6
11
  hash(path: tools.FilePathAbsolute | tools.FilePathRelative): Promise<FileHashResult>;
@@ -29,6 +29,7 @@ export class RemoteFileStorageNoopAdapter implements RemoteFileStoragePort {
29
29
  etag: "noop",
30
30
  size: tools.Size.fromBytes(10),
31
31
  lastModified: tools.Timestamp.parse(Date.now()),
32
+ mime: new tools.Mime("text/plain"),
32
33
  };
33
34
  }
34
35