return-style
The module that defines the return value style of Function/Constructor/Promise with 100% test coverage and TypeScript type definitions.
Installation
npm install --save return-style
yarn add return-style
API
Custom
- returnCustomAsync
- returnCustomSync
- returnCustom
- getCustomPromise
Error
- returnError
- returnErrorAsync
- returnErrorSync
- newError
- newErrorAsync
- newErrorSync
- getError
- getErrorAsync
- getErrorSync
- getErrorPromise
Result
- returnResult
- returnResultAsync
- returnResultSync
- newResult
- newResultAsync
- newResultSync
- getResult
- getResultAsync
- getResultSync
- getResultPromise
Tuple [Error, Result]
- returnErrorResult
- returnErrorResultAsync
- returnErrorResultSync
- newErrorResult
- newErrorResultAsync
- newErrorResultSync
- getErrorResult
- getErrorResultAsync
- getErrorResultSync
- getErrorResultPromise
Tuple [Result, Error]
- returnResultError
- returnResultErrorAsync
- returnResultErrorSync
- newResultError
- newResultErrorAsync
- newResultErrorSync
- getResultError
- getResultErrorAsync
- getResultErrorSync
- getResultErrorPromise