Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 1.05 KB

types.basetypeimpl.andthen.md

File metadata and controls

27 lines (16 loc) · 1.05 KB

Home > @skunkteam/types > BaseTypeImpl > andThen

BaseTypeImpl.andThen() method

Create a function with validated input.

Signature:

andThen<Return, RestArgs extends unknown[]>(fn: (value: ResultType, ...restArgs: RestArgs) => Return): (input: unknown, ...restArgs: RestArgs) => Return;

Parameters

Parameter Type Description
fn (value: ResultType, ...restArgs: RestArgs) => Return the function with input to be checked

Returns:

(input: unknown, ...restArgs: RestArgs) => Return

Remarks

Note that only the first parameter to the function is checked. The resulting function can be used as a parser and integrates nicely with other types.