Function: valid()
valid<
T>(value):Valid<T>
Defined in: validation/constructors/index.ts:27
Creates a Valid validation containing a value.
Type Parameters
T
T
Parameters
value
T
The value to wrap
Returns
Valid<T>
A Valid validation containing the value
Example
const result = valid(42)
// => { _tag: 'Valid', value: 42 }
const user = valid({ name: 'John', email: 'john@example.com' })
// => { _tag: 'Valid', value: { name: 'John', email: 'john@example.com' } }