jcayzac
jcayzac
Explore posts from servers
DDeno
Created by √((sec²(冥))➖ 1) on 5/20/2024 in #help
how to get WebSocketStream's current state?
You must manage state yourself, based on events you receive and the underlying streams (.readable and .writable).
2 replies
DDeno
Created by jcayzac on 5/15/2024 in #help
shebang and no file extension: how do I turn Typescript on?
--ext ts, damn how did I miss it!
3 replies
DDeno
Created by Phatso on 5/10/2024 in #help
Websockets API with async processing (is there a better way?)
(I really wish it was public and marked "stable")
12 replies
DDeno
Created by Phatso on 5/10/2024 in #help
Websockets API with async processing (is there a better way?)
For anything you need to serialize, personally I rely on the v8 serializer, but it's in Deno[Deno.internal].core so I guess it's a bad habit 🙂
12 replies
DDeno
Created by Phatso on 5/10/2024 in #help
Websockets API with async processing (is there a better way?)
Are you sending requests to your workers using JSON? It must be pretty slow. You should be able to pass anything that's Transferrable as-is.
12 replies
DDeno
Created by jcayzac on 5/1/2024 in #help
Where has std/hash/sha3.ts gone?
Even has BLAKE3 🎉
6 replies
DDeno
Created by jcayzac on 5/1/2024 in #help
Where has std/hash/sha3.ts gone?
@Leokuma oh wow, I couldn't find it, thanks a lot!
6 replies
DDeno
Created by Bairdy on 1/14/2024 in #help
Can Deno list all functions within a script without explicit registration or annotation?
Try with this instead of globalThis, maybe?
4 replies
DDeno
Created by jcayzac on 1/10/2024 in #help
How to build a Response object with the 'url' property set
No bot, you cannot set a readonly property 🙂
4 replies
DDeno
Created by jcayzac on 1/10/2024 in #help
How to build a Response object with the 'url' property set
Never mind, this works:
const response = (url: string, headers: HeadersInit) => {
const r = new Response(null, { headers })
Object.defineProperty(r, 'url', { value: url })
return r
}
const response = (url: string, headers: HeadersInit) => {
const r = new Response(null, { headers })
Object.defineProperty(r, 'url', { value: url })
return r
}
4 replies
DDeno
Created by jcayzac on 1/5/2024 in #help
Abort signals and node compatibility
4 replies
DDeno
Created by jcayzac on 1/5/2024 in #help
std/http/setCookie doesn't work?
No description
7 replies
DDeno
Created by jcayzac on 1/5/2024 in #help
std/http/setCookie doesn't work?
The lack of a cookie jar for fetch() is pretty sad. I would put that pretty high on my wishlist…
7 replies
DDeno
Created by jcayzac on 1/5/2024 in #help
std/http/setCookie doesn't work?
Right, but then I don't need std/http.
7 replies
DDeno
Created by jcayzac on 12/15/2023 in #help
Is there a way to get deno coverage information in a vscode lens?
Which repo should I create that one in? The main repo, right? Edit: https://github.com/denoland/deno/issues/21652
16 replies
DDeno
Created by jcayzac on 12/15/2023 in #help
Is there a way to get deno coverage information in a vscode lens?
16 replies
DDeno
Created by jcayzac on 12/20/2023 in #help
assertThrows() limitations
7 replies
DDeno
Created by jcayzac on 12/20/2023 in #help
assertThrows() limitations
I wish I could do
const { name } = await assertThrows(async () => { … }, DOMException))
assertEquals(name, 'AbortError')
const { name } = await assertThrows(async () => { … }, DOMException))
assertEquals(name, 'AbortError')
7 replies
DDeno
Created by jcayzac on 12/20/2023 in #help
assertThrows() limitations
I just want a std assert I can replace the following with:
try {
await
} catch (ex) {
assertInstanceOf(ex, DOMException)
assertEquals(ex.name, 'AbortError')
}
try {
await
} catch (ex) {
assertInstanceOf(ex, DOMException)
assertEquals(ex.name, 'AbortError')
}
7 replies
DDeno
Created by jcayzac on 12/20/2023 in #help
assertThrows() limitations
Now, it's an async call I have in my try/catch, and assertThrows() doesn't support PromiseLike
7 replies