index.js
function transformChunk(chunk, encoding, done) {
    if (chunk.isNull()) return done();
    if (chunk.isStream()) return this.emit('error', new PluginError(logFlag, 'Streaming not supported'));
    if (
      !(chunk.isMarkdown = options.regexpMarkdown.test(chunk.relative)) &&
      !(chunk.isTemplate = options.regexpTemplate.test(chunk.relative)) &&
      !(chunk.isHtml = options.regexpHtml.test(chunk.relative))
    ) {
      return options.passThrough ? done(null, chunk) : done();
    }
    transformChunkData(chunk);
    if (chunk.data.draft && process.env.NODE_ENV !== 'development') return done();
    if (buffer.hasOwnProperty(chunk.relative)) {
      logDuplicate(chunk);
      return done();
    }
    transformChunkContents.call(this, chunk);
    buffer[chunk.relative] = chunk;
    done(null, chunk);
  }
function transformChunk(chunk, encoding, done) {
    if (chunk.isNull()) return done();
    if (chunk.isStream()) return this.emit('error', new PluginError(logFlag, 'Streaming not supported'));
    if (
      !(chunk.isMarkdown = options.regexpMarkdown.test(chunk.relative)) &&
      !(chunk.isTemplate = options.regexpTemplate.test(chunk.relative)) &&
      !(chunk.isHtml = options.regexpHtml.test(chunk.relative))
    ) {
      return options.passThrough ? done(null, chunk) : done();
    }
    transformChunkData(chunk);
    if (chunk.data.draft && process.env.NODE_ENV !== 'development') return done();
    if (buffer.hasOwnProperty(chunk.relative)) {
      logDuplicate(chunk);
      return done();
    }
    transformChunkContents.call(this, chunk);
    buffer[chunk.relative] = chunk;
    done(null, chunk);
  }
function transformChunk ( chunk , encoding , done ) { if ( chunk . isNull ( ) ) return done ( ) ; if ( chunk . isStream ( ) ) return this . emit ( 'error' , new PluginError ( logFlag , 'Streaming not supported' ) ) ; if ( ! ( chunk . isMarkdown = options . regexpMarkdown . test ( chunk . relative ) ) && ! ( chunk . isTemplate = options . regexpTemplate . test ( chunk . relative ) ) && ! ( chunk . isHtml = options . regexpHtml . test ( chunk . relative ) ) ) { return options . passThrough ? done ( null , chunk ) : done ( ) ; } transformChunkData ( chunk ) ; if ( chunk . data . draft && process . env . NODE_ENV !== 'development' ) return done ( ) ; if ( buffer . hasOwnProperty ( chunk . relative ) ) { logDuplicate ( chunk ) ; return done ( ) ; } transformChunkContents . call ( this , chunk ) ; buffer [ chunk . relative ] = chunk ; done ( null , chunk ) ; }
transforms a stream chunk
@param  {object}   chunk    chunk object
@param  {string}   encoding file encoding
@param  {Function} done     callback
@return {undefined}
transforms a stream chunk