Actualizacion maquina principal
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / nice-try / src / index.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/nice-try/src/index.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/nice-try/src/index.js
new file mode 100644 (file)
index 0000000..837506f
--- /dev/null
@@ -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) {}
+
+}
\ No newline at end of file