intercept an op rust-side and call the original fn
deno_core and some exts embedded in a desktop application, and am trying to replace an existing op with my own version in which i do some additional checks before calling to the original op's function. i can replace the op using Extension::middleware_fn, but i can't see a way to access the original op's function.
the simplest way i can think to do this would be to modify the op2 macro to expose the raw function. am i missing something simpler?
for context, i want to modify op_ws_create from deno_websocket to do a (potentially asynchronous) permission check, and add some default headers. i don't want to do it javascript-side because i worry that would be exploitable, but maybe it can be done safely (my js knowledge is far below my rust knowledge). i can't use the built-in WebSocketPermissions trait as it is a synchronous function (i guess i could modify it to be async instead)....Why Deno runtime is differently when running locally or through Deno Cloud?
Deno JSR API package + CLI entrypoint "best-practices"
deno.land/x, the JS API entrypoint would be in mod.ts and the CLI entrypoint in main.ts; something like:
...Formatting with VSCode adds a tab instead of 2 spaces
Type-narrowing/covariance/contravariance
5 has type 5 but {five:5} has type {five:number} and not {five:5}?Ensure error is of type unknown with Deno lint
catch (error) { block.
The issue is resolved when I change it to error: unknown, as I then get a type error in the function I call later.
When the error is any, I get no warning, and I'm quite sure I'll forget to manually add : unknown to all my errors, so I'm looking for a way to guard for this π€...Deno - Cloudflare Pages compatibility?
Using bitbucket repositories as dependencies in Deno
Trouble with serving HTMl on localhost
deno run --allow-net example.ts, and I open up any pages on localhost:8080/page{0-4}, I see a blank white screen. I have narrowed down the problem to lines 48-75 in the file linked below. Where am I going wrong? I tried a simple console.log from within the handler closure to no avail. What am I missing here? Link to the file:
https://github.com/angeldollface/mina/blob/main/src/server.ts...How do you define an op in rust to return a string?
onClick not staying with preact-render-to-string?
Deno project suddenly won't launch in VS Code
Deno BYOW help with macOS [Solved] and X11
How can I add a flag into Deno Deploy in production?
Uploading Files to S3 Bucket usign deno-s3-lite-client
Deno.cron error
import "./mongoTestCron.ts";
import "./mongoTestCron.ts";
How to rewrite this: `import * as base32 from "jsr:@std/encoding@0.224.3/base32.ts";`
https://jsr.io/@std/encoding/0.224.3/base32.tsDefault export has no call signatures
npm:@feathersjs/express, but Deno complains that the default export has no call signatures.
```ts
// main.ts
import express from "npm:@feathersjs/express";...Catch/handle WebSocketStream connection reset error
WebSocketStream and catching on wss.opened and on wss.closed still this error is uncaught from somewhere - error: Uncaught (in promise) WebSocketError: connection reset
at new WebSocketError (ext:deno_websocket/02_websocketstream.js:478:5)
at Object.pull (ext:deno_websocket/02_websocketstream.js:270:31)
at eventLoopTick (ext:core/01_core.js:168:7)
error: Uncaught (in promise) WebSocketError: connection reset
at new WebSocketError (ext:deno_websocket/02_websocketstream.js:478:5)
at Object.pull (ext:deno_websocket/02_websocketstream.js:270:31)
at eventLoopTick (ext:core/01_core.js:168:7)