Typescript
Verifica comes with type definitions, so no additional packages are needed.
ensure()
Function ensure
returns the checked value if the predicate
matches. The type of returned value is the same as the generic parameter type of the Predicate<TOut>
. This allows to use the value with the correct type after ensuring it matches the predicate
:
Last updated
Was this helpful?