Created
November 22, 2016 04:25
-
-
Save Swivelgames/aafc6841e5ed81f80bcf7b4d0b7eccc3 to your computer and use it in GitHub Desktop.
getCurrentStack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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