You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
290 B
15 lines
290 B
2 years ago
|
var isNil = require('./isNil');
|
||
|
exports = function(fn) {
|
||
|
if (isNil(fn)) return '';
|
||
|
try {
|
||
|
return fnToStr.call(fn);
|
||
|
} catch (e) {}
|
||
|
try {
|
||
|
return fn + '';
|
||
|
} catch (e) {}
|
||
|
return '';
|
||
|
};
|
||
|
var fnToStr = Function.prototype.toString;
|
||
|
|
||
|
module.exports = exports;
|