Skip to content

Commit

Permalink
chore: fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 8, 2023
1 parent 68c9864 commit 76dd36d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/runtime/_internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export function notImplemented(name: string) {
return Object.assign(fn, { __unenv__: true });
}

export function notImplementedClass(name: string) {
export function notImplementedClass<T = unknown>(name: string): T {
return class {
readonly __unenv__ = true;
constructor() {
throw new Error(`[unenv] ${name} is not implemented yet!`);
}
};
} as T;
}
2 changes: 1 addition & 1 deletion src/runtime/fetch/call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function createCall(handle: Handle) {
// https://developer.mozilla.org/en-US/docs/Web/API/Response/body
// TODO: Ensure _data is either of BodyInit (or narrower) types
// Blob | ArrayBuffer | TypedArray | DataView | FormData | ReadableStream | URLSearchParams | String
let body = res._data as BodyInit | null;
let body = (res as any)._data as BodyInit | null;
if (
nullBodyResponses.has(res.statusCode) ||
req.method.toUpperCase() === "HEAD"
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/node/async_hooks/_async-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const AsyncHook: asyncHooks.AsyncHook =
export const createHook: typeof asyncHooks.createHook = function createHook(
callbacks,
) {
const asyncHook = new AsyncHook(callbacks);
const asyncHook = new _AsyncHook(callbacks);
return asyncHook;
};

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/node/async_hooks/_async-resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class _AsyncResource implements asyncHooks.AsyncResource {
thisArg?: ThisArg,
) {
const resource = new AsyncResource(type ?? "anonymous");
return resource.bind(fn, thisArg);
return resource.bind(fn);
}

bind<Func extends (...args: any[]) => any>(fn: Func, thisArg?: any) {
Expand Down

0 comments on commit 76dd36d

Please sign in to comment.