safe
Version:
Starting from version 0.4.0 safejs implements almost all functions of [Async](https://github.com/caolan/async) and can transparently replace it. For asyncjs functions library adds its error trap capabilities and also contain some optimizations and speed i
18 lines (15 loc) • 440 B
JavaScript
;
var isE6 = checkES6();
function checkES6() {
try {
new Function('a', 'class orig { constructor () { } }; class cls extends orig { constructor () { super() } }; var noop = () => { }; var foo = (f = noop, ...args) => [].push(...a); return foo;')([]);
return true;
} catch (err) {
return false;
}
}
if (!isE6) {
module.exports = require('./lib/safe.js');
} else {
module.exports = require('./lib/safe.modern.js');
}