mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
12 lines
303 B
JavaScript
12 lines
303 B
JavaScript
'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) {}
|
|
|
|
} |