More Deno cleanup

This commit is contained in:
Zef Hemel
2026-02-27 16:25:34 +01:00
parent 9e49794ac8
commit 380b5d90ca
18 changed files with 31 additions and 1064 deletions
+3 -8
View File
@@ -137,17 +137,12 @@ export const spaceluaApi = new LuaTable({
},
),
/**
* Returns your SilverBullet instance's base URL, or `undefined` when run on the server
* Returns your SilverBullet instance's base URL
*/
baseUrl: new LuaBuiltinFunction(
() => {
// Deal with Deno
if (typeof location === "undefined") {
return null;
} else {
//NOTE: Removing trailing slash to stay compatible with original code: `location.protocol + "//" + location.host;`
return document.baseURI.replace(/\/*$/, "");
}
//NOTE: Removing trailing slash to stay compatible with original code: `location.protocol + "//" + location.host;`
return document.baseURI.replace(/\/*$/, "");
},
),
});