-
-
Save DaniilBabanin/ac3c7a87dc547153826ddb0e0a0f3b9d to your computer and use it in GitHub Desktop.
console.log without base64 images (or other long strings)
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
function logObjWithoutBase64 () { | |
function rmb64(o) {if (typeof(o) == 'object') {for (var k in o) {o[k] = rmb64(o[k]);}} else if (typeof(o) == 'string' && o.length > 100) {return 'BASE64';}return o;} | |
var l = []; | |
for (var a in arguments) {if (typeof(arguments[a]) == 'object'){l.push(rmb64(JSON.parse(JSON.stringify(arguments[a]))));} else {l.push(arguments[a]);}} | |
console.log.apply(this, l); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment