New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gooddata/js-utils

Package Overview
Dependencies
Maintainers
39
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gooddata/js-utils - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

es/utils/load-script.d.ts

4

es/utils/walkme.js
import { isProductionHostname } from './env';
var loadJs = require('load-js');
import { loadScript } from './load-script';
export var GDC_WALKME_HASH = '325ea4b9b547463c991a62bf54090302';

@@ -22,3 +22,3 @@ export function generateFinalUrl(walkmeHashFromWhiteLabel) {

var url = generateFinalUrl(walkmeHash);
loadJs(url) // load walkme script
loadScript(url) // load walkme script
.catch(function () {

@@ -25,0 +25,0 @@ // tslint:disable-next-line:no-console

@@ -12,3 +12,4 @@ 'use strict';

var loadJs = require('load-js');
var _loadScript = require('./load-script');
var GDC_WALKME_HASH = exports.GDC_WALKME_HASH = '325ea4b9b547463c991a62bf54090302';

@@ -29,3 +30,3 @@ function generateFinalUrl(walkmeHashFromWhiteLabel) {

var url = generateFinalUrl(walkmeHash);
loadJs(url) // load walkme script
(0, _loadScript.loadScript)(url) // load walkme script
.catch(function () {

@@ -32,0 +33,0 @@ // tslint:disable-next-line:no-console

{
"name": "@gooddata/js-utils",
"version": "3.1.1",
"version": "3.1.2",
"description": "Various utils shared on GoodData frontend",

@@ -56,3 +56,2 @@ "repository": {

"js-cookie": "^2.1.4",
"load-js": "^3.0.2",
"lodash": "^4.17.4",

@@ -59,0 +58,0 @@ "lodash-es": "^4.17.4"

import { generateFinalUrl, load, GDC_WALKME_HASH } from '../walkme';
import { isProductionHostname } from '../env';
import { loadScript } from '../load-script';
jest.mock('../env');
jest.mock('load-js');
jest.mock('../load-script');
const loadJs = require('load-js');
describe('walkme', () => {

@@ -21,7 +20,7 @@

beforeEach(() => {
loadJs.mockImplementation(() => Promise.resolve());
(loadScript as any).mockImplementation(() => Promise.resolve());
});
afterEach(() => {
loadJs.mockClear();
(loadScript as any).mockClear();
(isProductionHostname as any).mockClear();

@@ -32,3 +31,3 @@ });

load('');
expect(loadJs.mock.calls.length).toBe(0);
expect((loadScript as any).mock.calls.length).toBe(0);
});

@@ -39,4 +38,6 @@

load(fakeHash);
expect(loadJs.mock.calls.length).toBe(1);
expect(loadJs).toBeCalledWith(`https://cdn.walkme.com/users/${fakeHash}/walkme_${fakeHash}_https.js`);
expect((loadScript as any).mock.calls.length).toBe(1);
expect((loadScript as any)).toBeCalledWith(
`https://cdn.walkme.com/users/${fakeHash}/walkme_${fakeHash}_https.js`
);
});

@@ -48,4 +49,4 @@

load(GDC_WALKME_HASH);
expect(loadJs.mock.calls.length).toBe(1);
expect(loadJs).toBeCalledWith(
expect((loadScript as any).mock.calls.length).toBe(1);
expect((loadScript as any)).toBeCalledWith(
`https://cdn.walkme.com/users/${GDC_WALKME_HASH}/test/walkme_${GDC_WALKME_HASH}_https.js`

@@ -59,4 +60,4 @@ );

load(GDC_WALKME_HASH);
expect(loadJs.mock.calls.length).toBe(1);
expect(loadJs).toBeCalledWith(
expect((loadScript as any).mock.calls.length).toBe(1);
expect((loadScript as any)).toBeCalledWith(
`https://cdn.walkme.com/users/${GDC_WALKME_HASH}/walkme_${GDC_WALKME_HASH}_https.js`

@@ -63,0 +64,0 @@ );

import { isProductionHostname } from './env';
import { loadScript } from './load-script';
const loadJs = require('load-js');
export const GDC_WALKME_HASH = '325ea4b9b547463c991a62bf54090302';

@@ -25,3 +24,4 @@

const url = generateFinalUrl(walkmeHash);
loadJs(url) // load walkme script
loadScript(url) // load walkme script
.catch(() => {

@@ -28,0 +28,0 @@ // tslint:disable-next-line:no-console

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