UNPKG

ds-algo-study

Version:

Just experimenting with publishing a package

14 lines (12 loc) 231 B
const catchStackOverflow = (fn, ...args) => { try { return fn(...args); } catch (err) { if (err instanceof RangeError) { throw new Error("Stack Overflow"); } } }; module.exports = { catchStackOverflow };