UI for Zipcoin Blue

index.js 686B

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. var through = require('through2');
  3. var falafel = require('falafel');
  4. module.exports = apply;
  5. function apply() {
  6. var buffers = [];
  7. return through(function(chunk, enc, next) {
  8. buffers.push(chunk);
  9. next();
  10. }, function(next) {
  11. var resp = falafel(Buffer.concat(buffers).toString(), {
  12. ecmaVersion: 6,
  13. allowReturnOutsideFunction: true
  14. }, function (node) {
  15. if (
  16. node.type === 'MemberExpression' &&
  17. node.object && node.property &&
  18. node.object.name === 'process'
  19. && node.property.name === 'browser'
  20. ) {
  21. node.update('true');
  22. }
  23. });
  24. this.push(resp.toString());
  25. next();
  26. });
  27. }