diff --git a/src/cli/commands/crypto.ts b/src/cli/commands/crypto.ts index ae41c8e..479460a 100644 --- a/src/cli/commands/crypto.ts +++ b/src/cli/commands/crypto.ts @@ -11,6 +11,9 @@ import { DependencyFilter } from '../../sdk/tree/Filters/DependencyFilter'; import { CryptoCfg } from '../../sdk/Cryptography/CryptoCfg'; import fs from 'fs'; import { BinaryFilter } from '../../sdk/tree/Filters/BinaryFilter'; +import { ScanFilter } from '../../sdk/tree/Filters/ScanFilter'; +import { FilterAND } from '../../sdk/tree/Filters/FilterAND'; +import { isBinaryFileSync } from 'isbinaryfile'; export async function cryptoHandler(rootPath: string, options: any): Promise { rootPath = rootPath.replace(/\/$/, ''); // Remove trailing slash if exists @@ -31,7 +34,7 @@ export async function cryptoHandler(rootPath: string, options: any): Promise; + + constructor(filters: Array) { + super(); + this.filters = filters; + } + + public evaluate(node: Node): boolean { + let valid = false; + for(let i = 0; i < this.filters.length; i++) { + valid = this.filters[i].evaluate(node); + if(!valid) return false; + } + return valid; + } + +}