We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sounds like redundant complication of ES standard. Could you provide some examples or repo for the problematics? Because the problem seems farfetched.
The text was updated successfully, but these errors were encountered:
In their latest release, Bun decided to use an import attribute to interact with sqlite database:
sqlite
import db from './my.db' with {type: "sqlite"}; const {id} = db .query("SELECT id FROM users LIMIT 1") .get(); console.log(id); // 1
https://bun.sh/blog/bun-v1.0.23
Sorry, something went wrong.
check support sample.
async function enableWithTypeSyntax([type, dataUrl, ok]) { let enableWithTypeSyntax = false; const option = (() => { const option = {}; const w = {type}; Reflect.defineProperty(option, "with", { get: () => (enableWithTypeSyntax=true,w), }); return option; })(); let result; try { const importMethod = new Function("dataUrl", "option", "return import(dataUrl, option);"); result = await importMethod(dataUrl, option); if (!enableWithTypeSyntax) return [false, new Error("not with read.")]; const isValid = typeof ok === "function" ? ok(result?.["default"], result) : !!ok; if (!isValid) return [false, new Error("type is invalid", {cause: {default: result?.default, module: result}})]; return [true,"ok"]; }catch(e){ if (e instanceof SyntaxError) return [false, new Error("not supported. import attribute syntax", {cause:e})] return [false, e]; } }
playground
No branches or pull requests
Sounds like redundant complication of ES standard. Could you provide some examples or repo for the problematics?
Because the problem seems farfetched.
The text was updated successfully, but these errors were encountered: