Skip to the content

Capsid menu

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

The functions of worker-preview.ts
FunctionLinesComplexityCoveredCRAPMutation
isWorkerPreview6 to 81No data: no coverage report in this mapNo data: no coverage report in this mapNo 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";
}