UNPKG

ds-algo-study

Version:

Just experimenting with publishing a package

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