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

@giphy/js-analytics

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@giphy/js-analytics - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

5

dist/pingback.js

@@ -28,2 +28,7 @@ "use strict";

var gif = _a.gif, user = _a.user, responseId = _a.responseId, pingbackType = _a.type, actionType = _a.actionType, position = _a.position;
// not all endpoints provide a response_id
if (!responseId) {
js_util_1.Logger.debug("Pingback aborted for " + gif.id + ", no responseId");
return;
}
var id = gif.id, _b = gif.bottle_data, bottle_data = _b === void 0 ? {} : _b;

@@ -30,0 +35,0 @@ var tid = bottle_data.tid;

4

package.json

@@ -11,3 +11,3 @@ {

"name": "@giphy/js-analytics",
"version": "1.3.1",
"version": "1.3.2",
"main": "dist/index.js",

@@ -39,3 +39,3 @@ "types": "dist/index.d.ts",

},
"gitHead": "296180057a9d81c5d47a325cd3eff8c4b1c69b35"
"gitHead": "a1ff1ea09b78484e2f7ea6d541c4fa404a6cb2ee"
}

@@ -45,2 +45,16 @@ import { IGif, IUser } from '@giphy/js-types'

const position = { top: 0, left: 20 } as ClientRect
test('no response id', () => {
pingback({
gif: gif as IGif,
user,
// @ts-ignore
responseId: undefined,
type: 'GIF_RELATED',
actionType: 'CLICK',
position,
})
// @ts-ignore
expect(fetch.mock.calls.length).toEqual(0)
})
test('request', () => {

@@ -47,0 +61,0 @@ sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(['a', 'b', 'c']))

@@ -6,3 +6,3 @@ import { debounce } from 'throttle-debounce'

import { PingbackEventType } from '@giphy/js-types'
import { forEach } from '@giphy/js-util'
import { forEach, Logger } from '@giphy/js-util'
import { sendPingback } from './send-pingback'

@@ -35,2 +35,7 @@

const pingback = ({ gif, user, responseId, type: pingbackType, actionType, position }: Pingback) => {
// not all endpoints provide a response_id
if (!responseId) {
Logger.debug(`Pingback aborted for ${gif.id}, no responseId`)
return
}
const { id, bottle_data = {} } = gif

@@ -37,0 +42,0 @@ const { tid } = bottle_data

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