Permalink
Tag: v1.0.5
Find file Copy path
f4c36a2 Apr 22, 2018
1 contributor

Users who have contributed to this file

12 lines (9 sloc) 303 Bytes
'use strict'
/**
* Tries to execute a function and discards any error that occurs.
* @param {Function} fn - Function that might or might not throw an error.
* @returns {?*} Return-value of the function when no error occurred.
*/
module.exports = function(fn) {
try { return fn() } catch (e) {}
}