markdown-exit-s3-image 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/dist/index.mjs +2 -3
  2. package/package.json +5 -2
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { promises } from "node:fs";
2
+ import { thumbHashToDataURL } from "thumbhash";
2
3
 
3
4
  //#region src/cache.ts
4
5
  var ImageCache = class {
@@ -150,9 +151,7 @@ async function getBitifulThumbhash(imageUrl) {
150
151
  const response = await fetch(`${baseUrl}?fmt=thumbhash`);
151
152
  if (!response.ok) throw new Error(`HTTP ${response.status}: ${response.statusText}`);
152
153
  const base64String = await response.text();
153
- const thumbhashBytes = new Uint8Array(Buffer.from(base64String.trim(), "base64"));
154
- const { thumbHashToDataURL } = await import("thumbhash");
155
- return thumbHashToDataURL(thumbhashBytes);
154
+ return thumbHashToDataURL(new Uint8Array(Buffer.from(base64String.trim(), "base64")));
156
155
  } catch (error) {
157
156
  console.warn(`[Bitiful] Thumbhash error for ${imageUrl}:`, error instanceof Error ? error.message : String(error));
158
157
  return null;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "markdown-exit-s3-image",
3
3
  "type": "module",
4
- "author": "gnix_aij",
5
- "version": "1.0.0",
4
+ "author": "GnixAij",
5
+ "version": "1.0.1",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -40,5 +40,8 @@
40
40
  "@types/node": "^24.10.1",
41
41
  "tsdown": "^0.16.6",
42
42
  "typescript": "^5.9.3"
43
+ },
44
+ "dependencies": {
45
+ "thumbhash": "^0.1.1"
43
46
  }
44
47
  }