Code coverage report for gulp-watch/lib/getContents/index.js

Statements: 91.67% (11 / 12)      Branches: 75% (3 / 4)      Functions: 100% (2 / 2)      Lines: 91.67% (11 / 12)     

All files » gulp-watch/lib/getContents/ » index.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 251   1   1 1   1 8 7         7 5       2       1  
'use strict';
 
var through2 = require('through2');
 
var bufferFile = require('./bufferFile');
var streamFile = require('./streamFile');
 
function getContents(opt) {
  return through2.obj(function (file, enc, cb) {
    Iif (file.isDirectory()) {
      cb(null, file);
    }
 
    // read and pass full contents
    if (opt.buffer !== false) {
      return bufferFile(file, cb);
    }
 
    // dont buffer anything - just pass streams
    return streamFile(file, cb);
  });
}
 
module.exports = getContents;