Skip to content

Instantly share code, notes, and snippets.

@Swivelgames
Created November 22, 2016 04:25
Show Gist options
  • Save Swivelgames/aafc6841e5ed81f80bcf7b4d0b7eccc3 to your computer and use it in GitHub Desktop.
Save Swivelgames/aafc6841e5ed81f80bcf7b4d0b7eccc3 to your computer and use it in GitHub Desktop.
getCurrentStack
const getCurrentStack = () => {
try {
throw new Error();
} catch(e) {
return e.stack.replace(/[\n\r]+/g,'').match(/at\s+([^\s:]+)/g).map(v => v.replace(/at\s+/,''));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment