Skip to content

Commit

Permalink
feat(package): added test function to the service
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyNahas committed Jul 23, 2018
1 parent 2655933 commit 2e49ea2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/module/service/ngx-linkifyjs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ export class NgxLinkifyjsService {
return linkify.find(text);
}

test(value: string) {
return linkify.test(value);
test(value: string | string[]): boolean {
if (typeof value === 'string') {
return linkify.test(value);
}
return linkify.test(...value);
}

}

0 comments on commit 2e49ea2

Please sign in to comment.