This commit is contained in:
Frank
2025-09-18 10:59:01 -04:00
parent c87480cf93
commit 4ceabdffa0
156 changed files with 427 additions and 429 deletions

View File

@@ -0,0 +1,18 @@
import { env } from "cloudflare:workers"
export const Resource = new Proxy(
{},
{
get(_target, prop: string) {
if (prop in env) {
// @ts-expect-error
const value = env[prop]
return typeof value === "string" ? JSON.parse(value) : value
} else if (prop === "App") {
// @ts-expect-error
return JSON.parse(env.SST_RESOURCE_App)
}
throw new Error(`"${prop}" is not linked in your sst.config.ts (cloudflare)`)
},
},
) as Record<string, any>