UNPKG
forgot
Version:
latest (0.0.2)
0.0.2
0.0.1
Forgot the exceptions function throws, just go on
github.com/jarvys/node-forgot
jarvys/node-forgot
forgot
/
index.js
9 lines
(7 loc)
•
194 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
function
isFunction
(
obj
) {
return
toString.
call
(obj) ===
'[object Function]'
; }
module
.
exports
=
function
(
fn
) {
if
(!
isFunction
(fn))
return
;
try
{
return
fn
();}
catch
(e) {
console
.
error
(e);} }