Explorar el Código

Allow passing a function as a filter

Tor Arne Vestbø hace 4 años
padre
commit
566e2be112
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      tools/reports/backup/files.js

+ 2 - 0
tools/reports/backup/files.js

@@ -117,6 +117,8 @@ function isIncludedBySingleFilter (filter, item, filePath) {
 function isIncludedBySingleFilterCheck (filter, x) {
   if (filter instanceof RegExp)
     return x.search(filter) > -1
+  else if (filter instanceof Function)
+    return filter(x)
   else
     return x.indexOf(filter) > -1;
 }