Created
December 6, 2019 13:57
-
-
Save josephm28/77ebaa8e16afe0f08c99765256cff588 to your computer and use it in GitHub Desktop.
Add todo method to console
This file contains 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
console.todo = function(todo: string) { | |
var err = new Error(); | |
console.log(`%c\tTODO\t${todo}\t\n`, 'background: #66ba6559; color: #046884'); | |
console.groupCollapsed(); | |
console.log( | |
err.stack | |
.split('\n') | |
.slice(0, 3) | |
.join('\n'), | |
); | |
console.log(`^^^ That's the TODO location ^^^`); | |
console.groupEnd(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment