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.

index.js 303B

123456789101112
  1. 'use strict'
  2. /**
  3. * Tries to execute a function and discards any error that occurs.
  4. * @param {Function} fn - Function that might or might not throw an error.
  5. * @returns {?*} Return-value of the function when no error occurred.
  6. */
  7. module.exports = function(fn) {
  8. try { return fn() } catch (e) {}
  9. }