Socket
Socket
Sign inDemoInstall

@schibsted/niche-ads

Package Overview
Dependencies
Maintainers
7
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@schibsted/niche-ads - npm Package Compare versions

Comparing version 5.1.5 to 5.1.6

1

lib/utils/glimr.d.ts

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

export function fetchTags(options: any): Promise<any>;
export function getGlimrTags(options: any): Promise<any>;

16

lib/utils/glimr.js

@@ -15,10 +15,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const LOCAL_STORAGE_EXPIRATION = 24 * 60 * 60 * 1000;
export function getGlimrTags(options) {
export function fetchTags(options) {
return __awaiter(this, void 0, void 0, function* () {
const cachedTags = getFromLocalStorageWithExpiration(options.localStorageKey || LOCAL_STORAGE_KEY, options.localStorageExpiration || LOCAL_STORAGE_EXPIRATION);
if (cachedTags) {
return cachedTags;
}
const glimr = yield import('glimr-sdk');
glimr.setTagCacheTimeInSeconds(300); // 300 is max https://developer.glimr.io/docs/retrieving-audiences#settagcachetimeinseconds
return new Promise((resolve) => {

@@ -32,1 +27,10 @@ glimr.getTags(options.clientId || CLIENT_ID, (tags) => {

}
export function getGlimrTags(options) {
return __awaiter(this, void 0, void 0, function* () {
const cachedTags = getFromLocalStorageWithExpiration(options.localStorageKey || LOCAL_STORAGE_KEY, options.localStorageExpiration || LOCAL_STORAGE_EXPIRATION);
if (cachedTags) {
return cachedTags;
}
return fetchTags(options);
});
}
{
"name": "@schibsted/niche-ads",
"version": "5.1.5",
"version": "5.1.6",
"description": "Package containing ads logic reappearing across our projects",

@@ -27,6 +27,6 @@ "main": "lib/index.js",

"dependencies": {
"@schibsted/niche-utils": "^0.4.2",
"@schibsted/niche-utils": "^0.4.3",
"glimr-sdk": "^3.3.3"
},
"gitHead": "e4adf95152f7a254f3f531931e19814978b7e4cb"
"gitHead": "8230f7e47354e8bc6754f895703ef215ec060f74"
}

@@ -9,2 +9,13 @@ import { localStorage } from '@schibsted/niche-utils';

export async function fetchTags(options) {
const glimr = await import('glimr-sdk');
return new Promise((resolve) => {
glimr.getTags(options.clientId || CLIENT_ID, (tags) => {
saveToLocalStorageWithExpiration(options.localStorageKey || LOCAL_STORAGE_KEY, tags);
resolve(tags);
});
});
}
export async function getGlimrTags(options) {

@@ -20,11 +31,3 @@ const cachedTags = getFromLocalStorageWithExpiration(

const glimr = await import('glimr-sdk');
glimr.setTagCacheTimeInSeconds(300); // 300 is max https://developer.glimr.io/docs/retrieving-audiences#settagcachetimeinseconds
return new Promise((resolve) => {
glimr.getTags(options.clientId || CLIENT_ID, (tags) => {
saveToLocalStorageWithExpiration(options.localStorageKey || LOCAL_STORAGE_KEY, tags);
resolve(tags);
});
});
return fetchTags(options);
}
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