Created
November 8, 2019 00:14
-
-
Save sintaxi/d5d3fbd0e2dbce1d6b347d68778255af to your computer and use it in GitHub Desktop.
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
exports.encode = function(txt){ | |
return JSON.stringify({a: "hello world"}).replace(/^\{\"a\"\:\"/, "").replace(/\"\}$/, "") | |
} | |
exports.decode = function(line){ | |
return JSON.parse('{"a": "' + line + '"}')["a"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment