diff options
author | kumavis <aaron@kumavis.me> | 2016-04-09 05:24:10 +0800 |
---|---|---|
committer | kumavis <aaron@kumavis.me> | 2016-04-09 05:24:10 +0800 |
commit | 266e3c7ddb920c933355d559144bab6c633a65fb (patch) | |
tree | ce57869cb3f9eed23c6ff717004668a366a315dc /app/scripts/lib | |
parent | 379294f16415a6ca112c590b1bcc12448189d245 (diff) | |
download | tangerine-wallet-browser-266e3c7ddb920c933355d559144bab6c633a65fb.tar.gz tangerine-wallet-browser-266e3c7ddb920c933355d559144bab6c633a65fb.tar.zst tangerine-wallet-browser-266e3c7ddb920c933355d559144bab6c633a65fb.zip |
popup - fix web3 plumbing
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/stream-utils.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/scripts/lib/stream-utils.js b/app/scripts/lib/stream-utils.js new file mode 100644 index 000000000..12560ffd8 --- /dev/null +++ b/app/scripts/lib/stream-utils.js @@ -0,0 +1,21 @@ +const Through = require('through2') + + +module.exports = { + jsonParseStream: jsonParseStream, + jsonStringifyStream: jsonStringifyStream, +} + +function jsonParseStream(){ + return Through.obj(function(serialized, encoding, cb){ + this.push(JSON.parse(serialized)) + cb() + }) +} + +function jsonStringifyStream(){ + return Through.obj(function(obj, encoding, cb){ + this.push(JSON.stringify(obj)) + cb() + }) +} |