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

sajari

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sajari - npm Package Compare versions

Comparing version 0.8.3 to 0.9.0

2

package.json
{
"name": "sajari",
"version": "0.8.3",
"version": "0.9.0",
"description": "JavaScript SDK for access to the Sajari search API",

@@ -5,0 +5,0 @@ "author": {

/*
* api.js - The Sajari JavaScript API SDK
* Sajari Search API SDK
* https://www.sajari.com/
*/

@@ -9,8 +10,7 @@

var request = require('superagent');
var jsonp = require('superagent-jsonp'); // To use jsonp chain: .use(jsonp)
var log = require('loglevel');
var searchSeq = 1;
/*
* Sajari Search API SDK
* https://www.sajari.com/
*

@@ -420,8 +420,8 @@ * @param {string} company - Your company ID, see your dashboard

if (this.jsonp) {
req.use(jsonp);
} else {
req.send(data);
this.jsonpSend(path, data, opts.success, opts.failure);
return;
}
// Send the request and handle the response
req.send(data);
req.end(function(err, res) {

@@ -434,2 +434,33 @@ if (err) {

});
},
/**
* Performs a JSONP request. Asynchronsely either calls success() (with response), or failure().
*/
jsonpSend : function(path, args, success, failure) {
var uri = url.augmentUri(path, args);
var seq = '_jsonp_' + (searchSeq++);
var script = document.createElement('script');
window['__SJ'+seq] = function(response) {
success(response);
try {
delete window['__SJ'+seq];
} catch (e) {
window['__SJ'+seq] = undefined;
}
script.parentNode.removeChild(script);
};
script.onerror = function() {
failure();
try {
delete window['__SJ'+seq];
} catch (e) {
window['__SJ'+seq] = undefined;
}
script.parentNode.removeChild(script);
};
script.src = url.augmentUri(uri, { jsoncallback: '__SJ'+seq });
document.getElementsByTagName('head')[0].appendChild(script);
}

@@ -436,0 +467,0 @@ };

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