validateFlag
function validateFlag(input, basePath?): ValidationResult;Defined in: validation.ts:268
Validate a single flag: structure + semantic cross-field checks.
Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
input |
unknown |
undefined |
basePath? |
string |
"flag" |
Returns
Section titled “Returns”Example
Section titled “Example”import { validateFlag } from "@xtandard/flags";
const result = validateFlag({ key: "dark-mode", type: "boolean", enabled: true, defaultVariant: "off", variants: { on: { value: true }, off: { value: false } }, fallthrough: { variant: "off" },});// result.valid === true, result.errors === []