Skip to content

valid

function valid(): Valid;

The answer of a facet check when the value is fine as it is. You return it from the validate function of ctx.facets.define.

Valid

{ valid: true }

ctx.facets.define(minutes, {
validate: value => (typeof value === 'number' && value >= 0 ? valid() : invalid({ code: 'minutes', message: 'Minutes must be zero or more' })),
});