app/lib/worker-preview.ts
8 lines and 1 functions in DrDustinEdwards/dustinedwards-info, at commit 1590ba4 on 2026-10-24. This file on GitHub.
Functions
| Function | Lines | Complexity | Covered | CRAP | Mutation |
|---|---|---|---|---|---|
| isWorkerPreview | 6 to 8 | 1 | No data: no coverage report in this map | No data: no coverage report in this map | No data: no mutants in this code |
Imports
It imports no other module of this repo. Imported by app/routes/robots.ts, workers/app.ts.
Source
/**
* True on a Cloudflare Worker Preview, where `previews.vars.PREVIEW` is "1". Production carries the
* top-level "", so a missing or empty value is production. Not the /preview draft route, which is a
* different thing sharing the word.
*/
export function isWorkerPreview(env: { PREVIEW?: string }): boolean {
return env.PREVIEW === "1";
}