From e5bbbba7efac9436a1167ea56076221d4557dff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 22 Jan 2026 20:36:51 -0500 Subject: [PATCH] add ability to `dc.require` the `obsidian` package --- src/api/local-api.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/local-api.tsx b/src/api/local-api.tsx index fc886904b..6c39a7790 100644 --- a/src/api/local-api.tsx +++ b/src/api/local-api.tsx @@ -29,6 +29,7 @@ import { Expression } from "expression/expression"; import { Card } from "./ui/views/cards"; import { ListView } from "./ui/views/list"; import { Modal, Modals, SubmittableModal, useModalContext } from "./ui/views/modal"; +import * as obsidian from "obsidian"; /** * Local API provided to specific codeblocks when they are executing. @@ -96,6 +97,9 @@ export class DatacoreLocalApi { * ``` */ public async require(path: string | Link): Promise { + if (typeof path === "string" && path === "obsidian") { + return Result.success(obsidian); + } const result = await this.scriptCache.load(path, { dc: this }); return result.orElseThrow(); }