Validate an input given a condition
The validated type
The validation condition
The raw input
The parsed input
The failure message
validateIf(true, "1", 1, "Not a number") >> { valid: true, input: "1", parsed: 1, error: null, }; Copy
validateIf(true, "1", 1, "Not a number") >> { valid: true, input: "1", parsed: 1, error: null, };
Validate an input given a condition