code: function chunkTransducer(n, xform) {
    let count = 0;
    let part = [];
  
    return {
      [p.init]() {
        return xform[p.init]();
      },
  
      [p.step](acc, input) {
        part[count++] = input;
        if (count === n) {
          const out = part.slice(0, n);
          part = [];
          count = 0;
          return xform[p.step](acc, out);
        }
        return acc;
      },
  
      [p.result](value) {
        if (count > 0) {
          return ensureUncompleted(xform[p.step](value, part.slice(0, count)));
        }
        return xform[p.result](value);
      }
    };
  }
docs: A transducer function that is returned by the `{@link module:xduce.transducers.chunk|chunk}` transducer.
  
  @private
  
  @param {number} n The number of elements that should be in each chunk.
  @param {module:xduce~transducerObject} xform The transducer object that the new one should be chained to.
  @return {module:xduce~transducerObject} A new transducer object chained to the provided transducer object.