Public
Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { t as t2 } from "https://esm.town/v/tmcw/t";
export const tProxy = () => {
const t = t2;
return new Proxy(
{},
{
get: (target, prop: string) =>
prop in target
? target[prop]
: prop === "then"
? undefined // to avoid ValTown unwrapping the promise, caused the script to hang
: typeof prop !== "string"
? undefined // something is autocalling it with symbol
: prop === "ib"
? t("div", { $display: "inline-block" })
: prop === "s"
? t("span")
: prop === "d"
? t("div")
: t(prop),
}
) as Record<string, ReturnType<typeof t>>;
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023