aboutsummaryrefslogtreecommitdiff
path: root/node_modules/vinyl-fs/lib/filterSince.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/vinyl-fs/lib/filterSince.js')
-rw-r--r--node_modules/vinyl-fs/lib/filterSince.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/node_modules/vinyl-fs/lib/filterSince.js b/node_modules/vinyl-fs/lib/filterSince.js
new file mode 100644
index 000000000..234b58987
--- /dev/null
+++ b/node_modules/vinyl-fs/lib/filterSince.js
@@ -0,0 +1,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;
+ });
+};