Files
enviPy-bayer/static/js/ketcher2/node_modules/tryit/tryit.js
2025-06-23 20:13:54 +02:00

15 lines
257 B
JavaScript

// tryit
// Simple, re-usuable try-catch, this is a performance optimization
// and provides a cleaner API.
module.exports = function (fn, cb) {
var err;
try {
fn();
} catch (e) {
err = e;
}
if (cb) cb(err || null);
};