# All files filter-parse-async.js

100% Statements 12/12
100% Branches 0/0
100% Functions 3/3
100% Lines 12/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25

    1x
    1x
    1x

    1x
    176x

    176x
    176x
    176x

    9057x

    173x

    176x

    1x
     "use strict";

    let util = require("util");
    let ChunkStream = require("./chunkstream");
    let Filter = require("./filter-parse");

    let FilterAsync = (module.exports = function (bitmapInfo) {
      ChunkStream.call(this);

      let buffers = [];
      let that = this;
      this._filter = new Filter(bitmapInfo, {
        read: this.read.bind(this),
        write: function (buffer) {
          buffers.push(buffer);
        },
        complete: function () {
          that.emit("complete", Buffer.concat(buffers));
        },
      });

      this._filter.start();
    });
    util.inherits(FilterAsync, ChunkStream);