Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aller/site-id

Package Overview
Dependencies
Maintainers
20
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aller/site-id - npm Package Compare versions

Comparing version 2.0.5 to 2.1.0

7

lib/index.js

@@ -8,2 +8,3 @@ "use strict";

exports.getSiteId = getSiteId;
exports.isExternalUrl = isExternalUrl;
exports.hosts = exports.siteIds = void 0;

@@ -65,2 +66,8 @@

return hostsObject[host];
}
function isExternalUrl(url) {
return hosts.some(function (e) {
return url.includes(e);
});
}

2

package.json
{
"name": "@aller/site-id",
"version": "2.0.5",
"version": "2.1.0",
"description": "Site ID to host and vice versa",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -38,2 +38,6 @@ const siteIdsObject = {

function isExternalUrl(url) {
return hosts.some(e => url.includes(e));
}
export {

@@ -44,2 +48,3 @@ getHost,

hosts,
isExternalUrl,
};
import test from 'ava';
import { getHost, getSiteId } from '../src/index';
import { getHost, getSiteId, isExternalUrl } from '../src/index';

@@ -16,1 +16,11 @@ test('Should return correct host', (t) => {

});
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'));
});
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'));
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc