-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SP-717 Adds scan filter criteria on local crypto scannning
* SP-717 Adds scan filter criteria on local crypto scannning --------- Co-authored-by: Franco Stramana <[email protected]>
- Loading branch information
1 parent
5de67be
commit 9f0874d
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Node from "../Node"; | ||
import { Filter } from "./Filter"; | ||
|
||
export class FilterAND extends Filter { | ||
|
||
private filters: Array<Filter>; | ||
|
||
constructor(filters: Array<Filter>) { | ||
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; | ||
} | ||
|
||
} |