prepare.js 444 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. var through = require('through2');
  3. function prepareRead(optResolver) {
  4. function normalize(file, enc, callback) {
  5. var since = optResolver.resolve('since', file);
  6. // Skip this file if since option is set and current file is too old
  7. if (file.stat && file.stat.mtime <= since) {
  8. return callback();
  9. }
  10. return callback(null, file);
  11. }
  12. return through.obj(normalize);
  13. }
  14. module.exports = prepareRead;