Skip to content

Commit 0a4a115

Browse files
committed
chore: add test:types script
1 parent c934599 commit 0a4a115

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"play": "listhen -w ./playground/app.ts",
2828
"profile": "0x -o -D .profile -P 'autocannon -c 100 -p 10 -d 40 http://localhost:$PORT' ./playground/server.cjs",
2929
"release": "pnpm test && pnpm build && changelogen --release --publish --publishTag latest && git push --follow-tags",
30-
"test": "pnpm lint && vitest --run --coverage"
30+
"test": "pnpm lint && vitest --run --coverage && pnpm test:types",
31+
"test:types": "tsc --noEmit"
3132
},
3233
"resolutions": {
3334
"h3": "^1.14.0"

src/utils/proxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export async function proxyRequest(
6767
...opts,
6868
fetchOptions: {
6969
method,
70-
body,
70+
body: body as BodyInit,
7171
duplex,
7272
...opts.fetchOptions,
7373
headers: fetchHeaders,

src/utils/session.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,16 @@ export async function sealSession<T extends SessionDataT = SessionDataT>(
233233
(event.context.sessions?.[sessionName] as Session<T>) ||
234234
(await getSession<T>(event, config));
235235

236-
const sealed = await seal(config.crypto || crypto, session, config.password, {
237-
...sealDefaults,
238-
ttl: config.maxAge ? config.maxAge * 1000 : 0,
239-
...config.seal,
240-
});
236+
const sealed = await seal(
237+
config.crypto || (crypto as any),
238+
session,
239+
config.password,
240+
{
241+
...sealDefaults,
242+
ttl: config.maxAge ? config.maxAge * 1000 : 0,
243+
...config.seal,
244+
},
245+
);
241246

242247
return sealed;
243248
}
@@ -251,7 +256,7 @@ export async function unsealSession(
251256
sealed: string,
252257
) {
253258
const unsealed = (await unseal(
254-
config.crypto || crypto,
259+
config.crypto || (crypto as any),
255260
sealed,
256261
config.password,
257262
{

0 commit comments

Comments
 (0)