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

cohere-js

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cohere-js - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

58

es/index.js

@@ -13,30 +13,42 @@ const hookInputSetter = (target, key) => {

hookInputSetter(HTMLInputElement.prototype, "value");
hookInputSetter(HTMLInputElement.prototype, "checked");
hookInputSetter(HTMLTextAreaElement.prototype, "value");
hookInputSetter(HTMLSelectElement.prototype, "value");
const isSSR = typeof window === "undefined";
if (!isSSR) {
hookInputSetter(HTMLInputElement.prototype, "value");
hookInputSetter(HTMLInputElement.prototype, "checked");
hookInputSetter(HTMLTextAreaElement.prototype, "value");
hookInputSetter(HTMLSelectElement.prototype, "value");
}
const bridgedMethods = ["init", "identify", "stop", "showCode"];
const noop = () => { };
const noopModule = {
init: noop,
identify: noop,
stop: noop,
showCode: noop,
};
// Create cohere or pass in previous args to init/initialize
// if script is not created
const Cohere = (window.Cohere = []);
Cohere.invoked = true;
Cohere.snippet = "0.3";
Cohere.valhook = true;
Cohere.methods = bridgedMethods;
Cohere.methods.forEach((method) => {
Cohere[method] = (...args) => {
args.unshift(method);
Cohere.push(args);
};
});
// Create an async script element based on your key
const script = document.createElement("script");
script.type = "text/javascript";
script.async = true;
script.src = "https://static.cohere.so/main.js";
// Insert our script before the first script element
const first = document.getElementsByTagName("script")[0];
first.parentNode.insertBefore(script, first);
let Cohere = isSSR ? noopModule : (window.Cohere = []);
if (!isSSR) {
Cohere.invoked = true;
Cohere.snippet = "0.4";
Cohere.valhook = true;
Cohere.methods = bridgedMethods;
Cohere.methods.forEach((method) => {
Cohere[method] = (...args) => {
args.unshift(method);
Cohere.push(args);
};
});
// Create an async script element based on your key
const script = document.createElement("script");
script.type = "text/javascript";
script.async = true;
script.src = "https://static.cohere.so/main.js";
// Insert our script before the first script element
const first = document.getElementsByTagName("script")[0];
first.parentNode.insertBefore(script, first);
}
const exportedModule = Cohere;
export default exportedModule;

@@ -15,30 +15,42 @@ 'use strict';

hookInputSetter(HTMLInputElement.prototype, "value");
hookInputSetter(HTMLInputElement.prototype, "checked");
hookInputSetter(HTMLTextAreaElement.prototype, "value");
hookInputSetter(HTMLSelectElement.prototype, "value");
const isSSR = typeof window === "undefined";
if (!isSSR) {
hookInputSetter(HTMLInputElement.prototype, "value");
hookInputSetter(HTMLInputElement.prototype, "checked");
hookInputSetter(HTMLTextAreaElement.prototype, "value");
hookInputSetter(HTMLSelectElement.prototype, "value");
}
const bridgedMethods = ["init", "identify", "stop", "showCode"];
const noop = () => { };
const noopModule = {
init: noop,
identify: noop,
stop: noop,
showCode: noop,
};
// Create cohere or pass in previous args to init/initialize
// if script is not created
const Cohere = (window.Cohere = []);
Cohere.invoked = true;
Cohere.snippet = "0.3";
Cohere.valhook = true;
Cohere.methods = bridgedMethods;
Cohere.methods.forEach((method) => {
Cohere[method] = (...args) => {
args.unshift(method);
Cohere.push(args);
};
});
// Create an async script element based on your key
const script = document.createElement("script");
script.type = "text/javascript";
script.async = true;
script.src = "https://static.cohere.so/main.js";
// Insert our script before the first script element
const first = document.getElementsByTagName("script")[0];
first.parentNode.insertBefore(script, first);
let Cohere = isSSR ? noopModule : (window.Cohere = []);
if (!isSSR) {
Cohere.invoked = true;
Cohere.snippet = "0.4";
Cohere.valhook = true;
Cohere.methods = bridgedMethods;
Cohere.methods.forEach((method) => {
Cohere[method] = (...args) => {
args.unshift(method);
Cohere.push(args);
};
});
// Create an async script element based on your key
const script = document.createElement("script");
script.type = "text/javascript";
script.async = true;
script.src = "https://static.cohere.so/main.js";
// Insert our script before the first script element
const first = document.getElementsByTagName("script")[0];
first.parentNode.insertBefore(script, first);
}
const exportedModule = Cohere;
module.exports = exportedModule;
{
"name": "cohere-js",
"version": "1.0.5",
"version": "1.0.6",
"description": "Cohere.so JS SDK",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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