UNPKG
go-fns
Version:
latest (1.0.0)
1.0.0
Utility functions for functions.
github.com/koyote130708/go-fns
koyote130708/go-fns
go-fns
/
src
/
expectFunction.js
8 lines
(7 loc)
•
196 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
function
expectFunction
(
arg
) {
if
(
typeof
arg !==
"function"
) {
throw
new
TypeError
(
"Expected a function, but found: "
+ arg); }
return
arg; }
module
.
exports
= expectFunction;