@aller/site-id
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -68,5 +68,5 @@ "use strict"; | ||
function isExternalUrl(url) { | ||
return hosts.some(function (e) { | ||
return !hosts.some(function (e) { | ||
return url.includes(e); | ||
}); | ||
} |
{ | ||
"name": "@aller/site-id", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Site ID to host and vice versa", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -39,3 +39,3 @@ const siteIdsObject = { | ||
function isExternalUrl(url) { | ||
return hosts.some(e => url.includes(e)); | ||
return !hosts.some(e => url.includes(e)); | ||
} | ||
@@ -42,0 +42,0 @@ |
@@ -18,9 +18,9 @@ import test from 'ava'; | ||
test('Should be external sites', (t) => { | ||
t.false(isExternalUrl('https://www.nrk.no/norge/hauglie-til-stortinget_-_-alt-skal-fram-i-lyset-1.14768334')); | ||
t.false(isExternalUrl('https://www.tv2.no/spesialer/asted-norge/kapittel-8-babyen-i-containeren')); | ||
t.true(isExternalUrl('https://www.nrk.no/norge/hauglie-til-stortinget_-_-alt-skal-fram-i-lyset-1.14768334')); | ||
t.true(isExternalUrl('https://www.tv2.no/spesialer/asted-norge/kapittel-8-babyen-i-containeren')); | ||
}); | ||
test('Should not be external sites', (t) => { | ||
t.true(isExternalUrl('https://www.elbil24.no/nyheter/et-skritt-naermere-smartlading/71154774')); | ||
t.true(isExternalUrl('https://www.dagbladet.no/nyheter/sjekk-din-kommune/71783428')); | ||
t.false(isExternalUrl('https://www.elbil24.no/nyheter/et-skritt-naermere-smartlading/71154774')); | ||
t.false(isExternalUrl('https://www.dagbladet.no/nyheter/sjekk-din-kommune/71783428')); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6636