Procházet zdrojové kódy

Allow passing a function as a filter

Tor Arne Vestbø před 4 roky
rodič
revize
566e2be112
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  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;
 }