mirror of
https://github.com/github/codeql-action.git
synced 2026-05-08 23:00:26 +00:00
Initial commit (from f5274cbdce4ae7c9e4b937dcdf95ac70ae436d5f)
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
'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) {}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user