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

@aller/site-id

Package Overview
Dependencies
Maintainers
16
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 1.2.0 to 1.3.0

15

lib/index.js

@@ -13,3 +13,3 @@ 'use strict';

var siteIds = {
var siteIdsObject = {
'1': 'dagbladet.no',

@@ -30,4 +30,7 @@ '2': 'dinside.no',

var hosts = invert(siteIds);
var hostsObject = invert(siteIdsObject);
var siteIds = Object.keys(siteIdsObject).sort();
var hosts = Object.values(siteIdsObject).sort();
// Invert object key/values pairs

@@ -45,10 +48,12 @@ function invert(data) {

function getHost(siteId) {
return siteIds[siteId];
return siteIdsObject[siteId];
}
function getSiteId(host) {
return hosts[host];
return hostsObject[host];
}
exports.getHost = getHost;
exports.getSiteId = getSiteId;
exports.getSiteId = getSiteId;
exports.siteIds = siteIds;
exports.hosts = hosts;
{
"name": "@aller/site-id",
"version": "1.2.0",
"version": "1.3.0",
"description": "Site ID to host and vice versa",

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

@@ -7,6 +7,8 @@ # site-id

```js
import { getHost, getSiteId } from '@aller/site-id';
import { getHost, getSiteId, siteIds, hosts } from '@aller/site-id';
console.log(getHost(1)); // 'dagbladet.no'
console.log(getSiteId('dagbladet.no')); // '1'
console.log(siteIds); // [ '1', '2', ..., '141', '207' ]
console.log(hosts); // [ 'dagbladet.no', 'dinside.no', ..., 'topp.no', 'vi.no' ]
```

@@ -1,2 +0,2 @@

const siteIds = {
const siteIdsObject = {
'1': 'dagbladet.no',

@@ -17,4 +17,7 @@ '2': 'dinside.no',

const hosts = invert(siteIds);
const hostsObject = invert(siteIdsObject);
const siteIds = Object.keys(siteIdsObject).sort();
const hosts = Object.values(siteIdsObject).sort();
// Invert object key/values pairs

@@ -26,7 +29,7 @@ function invert(data) {

function getHost(siteId) {
return siteIds[siteId];
return siteIdsObject[siteId];
}
function getSiteId(host) {
return hosts[host];
return hostsObject[host];
}

@@ -37,2 +40,4 @@

getSiteId,
siteIds,
hosts,
};
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