@aller/blink
Advanced tools
Comparing version 8.26.3 to 8.27.0-alpha.0
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "8.26.3"; | ||
export declare const VERSION = "8.27.1"; | ||
/** | ||
@@ -3,0 +3,0 @@ * The minimum waiting time between each sending of active time events |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ACTIVE_TIME_INITIAL_MOBILE = exports.ACTIVE_TIME_WAIT = exports.VERSION = void 0; | ||
exports.VERSION = '8.26.3'; | ||
exports.VERSION = '8.27.1'; | ||
/** | ||
@@ -6,0 +6,0 @@ * The minimum waiting time between each sending of active time events |
@@ -7,5 +7,21 @@ "use strict"; | ||
var external_id_1 = __importDefault(require("@aller/external-id")); | ||
function stripQueryParams(url) { | ||
var urlObj = new URL(url); | ||
urlObj.search = ''; | ||
return urlObj.toString(); | ||
} | ||
var urlParamStripWhitelist = ['annonsorinnhold']; | ||
var whitelistedStripQueryParams = function (whitelist) { | ||
return function (url) { | ||
var urlParts = url.split(/[./]+/); | ||
if (urlParamStripWhitelist.some(function (word) { return urlParts.includes(word); }) === false) { | ||
return url; | ||
} | ||
return stripQueryParams(url); | ||
}; | ||
}; | ||
var stripWithWhitelist = whitelistedStripQueryParams(urlParamStripWhitelist); | ||
function getIdFromUrl(url, fallbackId) { | ||
try { | ||
return external_id_1.default(url); | ||
return external_id_1.default(stripWithWhitelist(url)); | ||
} | ||
@@ -12,0 +28,0 @@ catch (e) { |
{ | ||
"name": "@aller/blink", | ||
"version": "8.26.3", | ||
"version": "8.27.0-alpha.0", | ||
"description": "A library for tracking user behaviour.", | ||
@@ -69,3 +69,3 @@ "main": "lib/main.js", | ||
}, | ||
"gitHead": "fce883596d6c018b730765c3da11a1585f49a12f" | ||
"gitHead": "fb3565ab6547004148957f534afabe2ac50e4f05" | ||
} |
@@ -1,2 +0,2 @@ | ||
export const VERSION = '8.26.3'; | ||
export const VERSION = '8.27.1'; | ||
@@ -3,0 +3,0 @@ /** |
import getExternalId from '@aller/external-id'; | ||
function stripQueryParams(url: string): string { | ||
const urlObj = new URL(url); | ||
urlObj.search = ''; | ||
return urlObj.toString(); | ||
} | ||
const urlParamStripWhitelist = ['annonsorinnhold']; | ||
const whitelistedStripQueryParams = | ||
(whitelist: string[]) => | ||
(url: string): string => { | ||
const urlParts = url.split(/[./]+/); | ||
if ( | ||
urlParamStripWhitelist.some(word => urlParts.includes(word)) === false | ||
) { | ||
return url; | ||
} | ||
return stripQueryParams(url); | ||
}; | ||
const stripWithWhitelist = whitelistedStripQueryParams(urlParamStripWhitelist); | ||
export default function getIdFromUrl( | ||
@@ -8,3 +30,3 @@ url: string, | ||
try { | ||
return getExternalId(url); | ||
return getExternalId(stripWithWhitelist(url)); | ||
} catch (e) { | ||
@@ -11,0 +33,0 @@ return fallbackId; |
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
813929
17740
0
2