UNPKG
dashp
Version:
latest (0.11.0)
0.11.0
0.10.1
0.10.0
0.9.0
0.8.1
Utilities for monadic promises.
github.com/critocrito/dashp
critocrito/dashp
dashp
/
src
/
reject.js
8 lines
(6 loc)
•
208 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
import
{isError}
from
"./internal/is"
;
import
nameFn
from
"./internal/namefn"
;
export
default
nameFn
(
"reject"
,
(
e
) =>
{
if
(
isError
(e))
return
Promise
.
reject
(e);
return
Promise
.
reject
(
new
Error
(e)); });