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

azure-search

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-search - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

azure-search.min.js

60

index.js

@@ -57,35 +57,39 @@ var http = require('https');

});
res.on('end', function() {
if (cb) {
res.on('end', function() {
if (res.statusCode === 401) return cb({code: res.statusCode, name:"Error", message:"Unauthorised"});
if (res.statusCode === 404) return cb({code: res.statusCode, name:"Error", message:"Not Found"});
if (res.statusCode >= 500) return cb({code: res.statusCode, name:"Error", message:"Server Error"});
if (res.statusCode >= 400) return cb({code: res.statusCode, name:"Error", message:"Bad Request"});
if (result) {
try{
if (overrides && overrides.Accept == "text/plain"){
// do nothing
} else {
result = JSON.parse(result);
}
} catch (err) {
if (cb){
cb("failed to parse JSON:\n" + err + "\n " + result, null, res);
cb = undefined;
return;
}
}
if (!cb) return;
// Bail out if no result
if(!result){
if(res.statusCode < 200 || res.statusCode > 206){
return cb({ code: res.statusCode}, null, res); // Fail
} else {
result = undefined;
return cb(null, null, res); // Success with no body
}
if (cb){
cb(null, result, res);
cb = undefined;
return;
}
// Parse result
try {
if (overrides && overrides.Accept == "text/plain"){
// do nothing
} else {
result = JSON.parse(result);
}
} catch (err) {
return cb("failed to parse JSON:\n" + err + "\n " + result, null, res);
}
});
// Check for Azure error
var error = result.error;
if (error){
error.code = error.code || res.statusCode; // This is currently not populated by azure
cb(error, null, res);
}
else {
cb(null, result, res);
}
return;
});
res.on('error', function(err){

@@ -92,0 +96,0 @@ if (cb){

{
"name": "azure-search",
"version": "0.0.2",
"version": "0.0.3",
"description": "A client for the Azure Search service",

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

@@ -5,3 +5,3 @@ // to test, first create a search service in azure, and set the url and key here.

url: "https://xxx.search.windows.net",
key:"YYY"
key:"yyy"
});

@@ -8,0 +8,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