Skip to content

compileDraft

function compileDraft(draft, options): Snapshot;

Defined in: snapshot.ts:68

Compile a draft into an immutable snapshot. Does not persist anything.

Parameter Type
draft Draft
options CompileOptions

Snapshot

import { compileDraft } from "@xtandard/flags";
const snapshot = compileDraft(
{ projectKey: "default", environmentKey: "production", flags: {} },
{ version: "v1", createdBy: { id: "ci", name: "CI" } },
);
// snapshot.version === "v1"