Skip to content

Commit d6bdaf0

Browse files
tony8713claude
andcommitted
chore: bump sharp to 0.34.5 (binary as optional dep, no postinstall download)
Rebased onto test/resolver-image-snapshots. Keeps only the sharp dependency bump and the resize() return-type adaptation; test/snapshot changes are dropped since the new image-snapshot test helper handles them. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 4ff5e9c commit d6bdaf0

3 files changed

Lines changed: 199 additions & 217 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"node-fetch": "v2.7.0",
4343
"nodemon": "^2.0.7",
4444
"redis": "^4.6.10",
45-
"sharp": "^0.30.1",
45+
"sharp": "^0.34.5",
4646
"starknet": "^6.11.0",
4747
"ts-node": "^10.8.1",
4848
"typescript": "^4.7.3"

src/utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ export function sha256(str) {
4545
return createHash('sha256').update(str).digest('hex');
4646
}
4747

48-
export async function resize(input, w, h, options?) {
48+
// sharp >=0.34 ships stricter bundled types that infer this chain as
49+
// `Promise<false | Buffer>`, which breaks callers expecting a Buffer. Keep the
50+
// historical (sharp 0.30) `Promise<any>` contract so the bump needs no other
51+
// type churn; the runtime value is always a Buffer.
52+
export async function resize(input, w, h, options?): Promise<any> {
4953
return sharp(input).resize(w, h, options).webp().toBuffer();
5054
}
5155

0 commit comments

Comments
 (0)