Skip to content

validateSegment

function validateSegment(input, basePath?): ValidationResult;

Defined in: validation.ts:473

Validate a single reusable Segment: structure + inSegment value checks. Cross-entity reference/cycle checks live in ./segments.validateSegmentReferences.

Parameter Type Default value
input unknown undefined
basePath? string "segment"

ValidationResult

import { validateSegment } from "@xtandard/flags";
const result = validateSegment({
key: "eu-beta",
conditions: [{ attribute: "country", operator: "in", value: ["FR", "DE"] }],
});
// result.valid === true