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.9.0 to 0.9.1

2

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

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

@@ -437,28 +437,30 @@ /*

*/
jsonpSend : function(path, args, success, failure) {
jsonpSend: function(path, args, success, failure) {
var uri = url.augmentUri(path, args);
var seq = '_jsonp_' + (searchSeq++);
var script = document.createElement('script');
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);
};
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);
script.src = url.augmentUri(uri, {
jsoncallback: '__SJ' + seq
});
document.getElementsByTagName('head')[0].appendChild(script);
}

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

@@ -100,4 +100,9 @@ var isArray = require('./utils/isArray');

// Join the facet.fields array
if (this.options['facet.fields'] !== undefined) {
args['facet.fields'] = this.options['facet.fields'].join(',');
var ffs = this.options['facet.fields'];
if (ffs !== undefined) {
if (isArray(ffs)) {
args['facet.fields'] = ffs.join(',');
} else {
args['facet.fields'] = ffs;
}
}

@@ -104,0 +109,0 @@

@@ -99,1 +99,11 @@

});
var query5 = api.query();
query5.facetfields("disco", 5);
test('Query encoding 5', function (t) {
var enc = query5.encode();
t.equal(enc["facet.fields"], "disco");
t.end();
});
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