source: trip-planner-front/node_modules/nice-try/src/index.js@ 76712b2

Last change on this file since 76712b2 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 303 bytes
RevLine 
[6a3a178]1'use strict'
2
3/**
4 * Tries to execute a function and discards any error that occurs.
5 * @param {Function} fn - Function that might or might not throw an error.
6 * @returns {?*} Return-value of the function when no error occurred.
7 */
8module.exports = function(fn) {
9
10 try { return fn() } catch (e) {}
11
12}
Note: See TracBrowser for help on using the repository browser.