fixed tests
This commit is contained in:
parent
c60ce4a696
commit
389a4cb1c4
3 changed files with 33 additions and 3 deletions
|
@ -48,7 +48,7 @@ export class RegexMatchViewComponent implements ng.IComponentController {
|
|||
|
||||
}
|
||||
|
||||
public filterMatches(regexstr: string, items: any[], shouldMatch: boolean): any[] {
|
||||
public filterMatches(regexstr: string, items: ({value: string})[], shouldMatch: boolean): ({value: string})[] | null {
|
||||
regexstr = regexstr || '.+';
|
||||
|
||||
try {
|
||||
|
@ -58,8 +58,8 @@ export class RegexMatchViewComponent implements ng.IComponentController {
|
|||
}
|
||||
|
||||
return items.filter(function(item) {
|
||||
var value = item['value'];
|
||||
var m = value.match(regex);
|
||||
var value: string = item.value;
|
||||
var m: RegExpMatchArray = value.match(regex);
|
||||
var matches: boolean = !!(m && m[0].length == value.length);
|
||||
return matches == shouldMatch;
|
||||
});
|
||||
|
|
Reference in a new issue