aboutsummaryrefslogtreecommitdiff
path: root/node_modules/vinyl-fs/lib/filterSince.js
blob: 234b589878e1c13937e58977b38cbdf0cfecf33e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'use strict';

var filter = require('through2-filter');

module.exports = function(d) {
  var isValid = typeof d === 'number' ||
    d instanceof Number ||
    d instanceof Date;

  if (!isValid) {
    throw new Error('expected since option to be a date or a number');
  }
  return filter.obj(function(file) {
    return file.stat && file.stat.mtime > d;
  });
};