18 lines
333 B
JavaScript
Raw Normal View History

2020-05-19 11:43:42 +03:00
// tryor.js
// MIT licensed, see LICENSE file
// Copyright (c) 2013 Olov Lassus <olov.lassus@gmail.com>
function tryor(fn, v) {
"use strict";
try {
return fn();
} catch (e) {
return v;
}
};
if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
module.exports = tryor;
}