MCPcopy
hub / github.com/tldraw/tldraw / readEnv

Function readEnv

packages/editor/src/lib/utils/debug-flags.ts:150–156  ·  view source on GitHub ↗
(fn: () => string | undefined)

Source from the content-addressed store, hash-verified

148// chaining because some bundlers search for `process.env.SOMETHING` as a string
149// and replace it with its value.
150function readEnv(fn: () => string | undefined) {
151 try {
152 return fn()
153 } catch {
154 return null
155 }
156}
157
158function getDefaultValue<T>(def: DebugFlagDef<T>): T {
159 const env =

Callers 1

getDefaultValueFunction · 0.85

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…