Update deno (fix stream callback type)

This commit is contained in:
Val Packett 2024-07-26 06:01:03 -03:00
parent 9b9f97a646
commit 9d27e2c357
2 changed files with 8 additions and 6 deletions

View file

@ -73,7 +73,10 @@ function notifyMonitors(token: string, browserToken: string) {
// chan.close(); // -> Uncaught (in promise) BadResource: Bad resource ID ?!
}
function streamsponse(start: ReadableStreamDefaultControllerCallback<string>, init: ResponseInit | undefined) {
// ReadableStreamDefaultControllerCallback is deprecated
type CtrlCb<R> = (controller: ReadableStreamDefaultController<R>) => void | PromiseLike<void>;
function streamsponse(start: CtrlCb<string>, init: ResponseInit | undefined) {
return new Response(new ReadableStream({ start }).pipeThrough(new TextEncoderStream()), init);
}