Last active
March 18, 2021 16:05
-
-
Save gaurangrshah/99b73a5e999f2e39ae41454ec4ef3dde to your computer and use it in GitHub Desktop.
Random helpers
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
function isEmpty(value){ | |
return value === undefined || | |
value === null || | |
(typeof value === "object" && Object.keys(value).length === 0) || | |
(typeof value === "string" && value.trim().length === 0) | |
} |
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
function prettyLog (obj) { | |
console.log(JSON.stringify(obj, null, '\t')) | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment