From 2e49ea215335d53d59c1b8fd35833e228f0a0bf8 Mon Sep 17 00:00:00 2001 From: Anthony Nahas Date: Mon, 23 Jul 2018 22:22:45 +0200 Subject: [PATCH] feat(package): added `test` function to the service --- src/module/service/ngx-linkifyjs.service.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/module/service/ngx-linkifyjs.service.ts b/src/module/service/ngx-linkifyjs.service.ts index 8dc698e2..7b772197 100644 --- a/src/module/service/ngx-linkifyjs.service.ts +++ b/src/module/service/ngx-linkifyjs.service.ts @@ -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); } }