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

kameleoon-client-javascript

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kameleoon-client-javascript - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

52

dist/kameleoonUtils.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpMethod = void 0;
var node_fetch_1 = __importStar(require("node-fetch"));
var constants_1 = require("./constants");
var VERSION = "2.1.0";
var VERSION = "2.1.1";
var KameleoonUtils = /** @class */ (function () {

@@ -34,14 +54,20 @@ function KameleoonUtils() {

else {
var xhr_1 = new XMLHttpRequest();
xhr_1.onreadystatechange = function () {
if (xhr_1.readyState === 4) {
callback && callback(xhr_1.response);
}
};
xhr_1.open(method, url, true);
xhr_1.setRequestHeader("content-type", "application/x-www-form-urlencoded");
addKameleoonClientHeader &&
xhr_1.setRequestHeader("Kameleoon-Client", "sdk/js/" + VERSION);
userAgent && xhr_1.setRequestHeader("User-Agent", userAgent.value);
xhr_1.send(data ? data : null);
var headers = new node_fetch_1.Headers({
"Content-Type": "application/x-www-form-urlencoded",
});
if (addKameleoonClientHeader) {
headers.append("Kameleoon-Client", "sdk/js/".concat(VERSION));
}
if (userAgent) {
headers.append("User-Agent", userAgent.value);
}
var eventRequest = new node_fetch_1.Request(url, {
method: method,
body: data !== null && data !== void 0 ? data : null,
headers: headers,
});
(0, node_fetch_1.default)(eventRequest)
.then(function (response) { return response.text(); })
.then(function (responseText) { return callback && callback(responseText); })
.catch(function (err) { return console.log(err); });
}

@@ -48,0 +74,0 @@ };

{
"name": "kameleoon-client-javascript",
"version": "2.1.0",
"version": "2.1.1",
"description": "JavaScript SDK client",

@@ -20,2 +20,3 @@ "main": "dist/kameleoonClient.js",

"@types/node": "^14.17.5",
"@types/node-fetch": "^2.6.2",
"@typescript-eslint/eslint-plugin": "^5.4.0",

@@ -29,3 +30,6 @@ "@typescript-eslint/parser": "^5.4.0",

},
"typings": "dist/kameleoonClient.d.ts"
"typings": "dist/kameleoonClient.d.ts",
"dependencies": {
"node-fetch": "^2.6.9"
}
}
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