src/index.js
function transformEncode(chunk, encoding, cb) {
  try {
    encode(chunk, this[kschema], this);

    const buf = this.slice();
    this.consume(buf.length);

    cb(null, buf);
  } catch (error) {
    cb(error);
  }
}
function transformEncode(chunk, encoding, cb) {
  try {
    encode(chunk, this[kschema], this);

    const buf = this.slice();
    this.consume(buf.length);

    cb(null, buf);
  } catch (error) {
    cb(error);
  }
}
The `transform` function for transform stream.
@param {*} chunk Any valid js data type.
@param {string} encoding
@param {Function} cb