Last active
January 18, 2018 14:19
-
-
Save kirpalmakanga/1a5ce942f90f19cd77846a44bf6875d7 to your computer and use it in GitHub Desktop.
Get json string size
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
const bytes = (s) => ~-encodeURI(s).split(/%..|./).length; | |
const jsonSize = (s) => bytes(JSON.stringify(s)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment