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

@giphy/js-util

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@giphy/js-util - npm Package Compare versions

Comparing version 5.0.0 to 5.1.0-beta.0

dist/bestfit.d.ts

25

dist/index.d.ts

@@ -26,2 +26,23 @@ import { IRendition, IGif, IImage, IImages } from '@giphy/js-types';

type MoatData = {
moatClientLevel1: string;
moatClientLevel2: string;
moatClientLevel3: string;
moatClientLevel4: string;
moatClientSlicer1: string;
moatClientSlicer2: string;
zMoatPosition: string;
zMoatSession?: string;
};
type Tracker = {
vendor: string;
verificationParameters: any;
};
type TData = {
web?: Tracker[];
};
declare const constructMoatData: ({ tdata }: {
tdata: TData;
}) => MoatData | undefined;
/**

@@ -78,4 +99,6 @@ * @param el HTMLElement

declare const injectTrackingPixel: (tags?: string[]) => void;
declare const checkIfWebP: Promise<unknown>;
export { LogLevel, Logger, appendGiphySDKRequestHeader, appendGiphySDKRequestParam, bestfit, checkIfWebP, forEach, getAltText, getBestRendition, getBestRenditionUrl, getBestVideo, getClientRect, getGifHeight, getGifWidth, getGiphySDKRequestHeaders, getPingbackId, getSpecificRendition, mapValues, pick, setRenditionScaleUpMaxPixels, take, without };
export { LogLevel, Logger, appendGiphySDKRequestHeader, appendGiphySDKRequestParam, bestfit, checkIfWebP, constructMoatData, forEach, getAltText, getBestRendition, getBestRenditionUrl, getBestVideo, getClientRect, getGifHeight, getGifWidth, getGiphySDKRequestHeaders, getPingbackId, getSpecificRendition, injectTrackingPixel, mapValues, pick, setRenditionScaleUpMaxPixels, take, without };

@@ -125,2 +125,28 @@ var __defProp = Object.defineProperty;

// src/construct-moat-data.ts
var constructMoatData = ({ tdata }) => {
var _a;
const [moatTrackerData] = ((_a = tdata == null ? void 0 : tdata.web) == null ? void 0 : _a.filter((tracker) => tracker.vendor === "Moat")) || [];
if (moatTrackerData == null ? void 0 : moatTrackerData.verificationParameters) {
const {
moatClientLevel1 = "_ADVERTISER_",
moatClientLevel2 = "_CAMPAIGN_",
moatClientLevel3 = "_LINE_ITEM_",
moatClientLevel4 = "_CREATIVE_",
moatClientSlicer1 = "_SITE_",
moatClientSlicer2 = "_PLACEMENT_",
zMoatPosition = "_POSITION_"
} = moatTrackerData.verificationParameters;
return {
moatClientLevel1,
moatClientLevel2,
moatClientLevel3,
moatClientLevel4,
moatClientSlicer1,
moatClientSlicer2,
zMoatPosition
};
}
};
// src/get-client-rect-from-el.ts

@@ -298,2 +324,18 @@ var getClientRect = (el) => {

};
// src/tracking-pixel.ts
import DOMPurify from "dompurify";
var injectTrackingPixel = (tags = []) => {
tags.forEach((tag) => {
var _a;
const el = document.createElement("html");
tag = tag.replace("%%CACHEBUSTER%%", Date.now().toString());
el.innerHTML = DOMPurify.sanitize(tag);
const pixel = el.querySelector("img");
if (pixel) {
(_a = document == null ? void 0 : document.querySelector("head")) == null ? void 0 : _a.appendChild(pixel);
}
});
};
var tracking_pixel_default = injectTrackingPixel;
export {

@@ -306,2 +348,3 @@ LogLevel,

checkIfWebP,
constructMoatData,
forEach,

@@ -318,2 +361,3 @@ getAltText,

getSpecificRendition,
tracking_pixel_default as injectTrackingPixel,
mapValues,

@@ -320,0 +364,0 @@ pick,

6

package.json

@@ -12,3 +12,3 @@ {

"name": "@giphy/js-util",
"version": "5.0.0",
"version": "5.1.0-beta.0",
"description": "Shared giphy js utils",

@@ -38,4 +38,4 @@ "homepage": "https://github.com/Giphy/giphy-js/tree/master/packages/util",

"dependencies": {
"@giphy/js-types": "*",
"dompurify": "^2.2.2",
"@giphy/js-types": "5.1.0-beta.0",
"dompurify": "3.1.0",
"uuid": "^9.0.0"

@@ -42,0 +42,0 @@ },

export { default as bestfit, setRenditionScaleUpMaxPixels } from './bestfit'
export * from './collections'
export * from './construct-moat-data'
export { default as getClientRect } from './get-client-rect-from-el'

@@ -16,2 +17,3 @@ export { default as getPingbackId } from './get-pingback-id'

export * from './sdk-headers'
export { default as injectTrackingPixel } from './tracking-pixel'
export { checkIfWebP } from './webp-check'

Sorry, the diff of this file is not supported yet

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