UNPKG
assert-function
Version:
latest (1.0.0)
1.0.0
Assert that a value is a function
github.com/bendrucker/assert-function
bendrucker/assert-function
assert-function
/
index.js
8 lines
(6 loc)
•
168 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
'use strict'
module
.
exports
=
function
assertFunction
(
value
) {
if
(
typeof
value !==
'function'
) {
throw
new
TypeError
(
'Expected function, got: '
+ value) } }