UNPKG
@pnpm/ramda
Version:
latest (0.28.1)
0.28.1
A practical functional library for JavaScript programmers.
ramdajs.com
ramda/ramda
@pnpm/ramda
/
es
/
internal
/
_assertPromise.js
7 lines
•
274 B
JavaScript
View Raw
1
2
3
4
5
6
7
import
_isFunction
from
"./_isFunction.js"
;
import
_toString
from
"./_toString.js"
;
export
default
function
_assertPromise
(
name, p
) {
if
(p ==
null
|| !
_isFunction
(p.
then
)) {
throw
new
TypeError
(
'`'
+ name +
'` expected a Promise, received '
+
_toString
(p, [])); } }