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

search-sdk

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

search-sdk - npm Package Compare versions

Comparing version 0.2.4 to 0.3.0

54

lib/search.js
(function() {
var AzureSearch, Promise, Search, _,
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
slice = [].slice;

@@ -15,2 +16,6 @@

url = arg.url, key = arg.key, this.index = arg.index, this.facets = arg.facets;
this.suggest = bind(this.suggest, this);
this.find = bind(this.find, this);
this.remove = bind(this.remove, this);
this.save = bind(this.save, this);
this.client = Promise.promisifyAll(new AzureSearch({

@@ -43,26 +48,37 @@ url: url,

count: true
}, query)).spread(function(items, response) {
var __ignoreType, count, facets, next;
__ignoreType = function(value, key) {
return _.endsWith(key, "@odata.type");
};
next = _(response["@search.nextPageParameters"]).omit(__ignoreType).value();
facets = _(response["@search.facets"]).omitBy(__ignoreType).entries().map(function(arg) {
var key, value;
key = arg[0], value = arg[1];
}, query)).spread((function(_this) {
return function(items, response) {
var __ignoreType, count, facets, next;
__ignoreType = function(value, key) {
return _.endsWith(key, "@odata.type");
};
next = _(response["@search.nextPageParameters"]).omit(__ignoreType).value();
facets = _(response["@search.facets"]).omitBy(__ignoreType).entries().map(function(arg) {
var key, value;
key = arg[0], value = arg[1];
return {
key: key,
value: value
};
}).value();
count = response["@odata.count"];
return {
key: key,
value: value
items: items,
facets: facets,
next: next,
count: count
};
}).value();
count = response["@odata.count"];
return {
items: items,
facets: facets,
next: next,
count: count
};
});
})(this));
};
Search.prototype.suggest = function(query) {
if (query == null) {
query = {};
}
return this.client.suggestAsync(this.index, _.merge({
suggesterName: "sg"
}, query)).get("0");
};
return Search;

@@ -69,0 +85,0 @@

{
"name": "search-sdk",
"version": "0.2.4",
"version": "0.3.0",
"description": "search-sdk",

@@ -5,0 +5,0 @@ "main": "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