Skip to content

API reference > @kontsedal/olas-core > mustBeTrue

mustBeTrue() function ​

Reject any value that isn't boolean true — the "you must check this box" rule for consent / terms-of-service / confirm checkboxes. Unlike required (which now accepts false as a valid boolean), this fails on false.

Signature:

typescript
mustBeTrue: (message?: string) => Validator<boolean>

Parameters ​

Parameter

Type

Description

message

string

(Optional)

Returns:

Validator<boolean>

Released under the MIT License.