Socket
Socket
Sign inDemoInstall

mindee

Package Overview
Dependencies
Maintainers
8
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mindee - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

4

CHANGELOG.md
# CHANGELOG
## v2.1.1 - 2022-10-28
### Fixes
* :bug: fix for sending base64 documents.
## v2.1.0 - 2022-10-19

@@ -4,0 +8,0 @@ ### Changes

2

package.json
{
"name": "mindee",
"version": "2.1.0",
"version": "2.1.1",
"description": "Mindee Client Library for Node.js",

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

@@ -54,4 +54,2 @@ "use strict";

return new Promise((resolve, reject) => {
const form = new form_data_1.default();
let body;
let headers = {

@@ -62,2 +60,7 @@ "User-Agent": USER_AGENT,

const uri = new url_1.URL(`${this.urlRoot}/predict`);
if (cropper) {
uri.searchParams.append("cropper", "true");
}
logger_1.logger.debug(`Prediction request: ${uri}`);
const form = new form_data_1.default();
const fileParams = { filename: input.filename };

@@ -68,5 +71,2 @@ form.append("document", input.fileObject, fileParams);

}
if (cropper) {
uri.searchParams.append("cropper", "true");
}
headers = { ...headers, ...form.getHeaders() };

@@ -79,3 +79,2 @@ const options = {

};
logger_1.logger.debug(`Prediction request: ${uri}`);
const req = https.request(options, function (res) {

@@ -100,12 +99,6 @@ // when the encoding is set, data chunks will be strings

});
form.pipe(req);
req.on("error", (err) => {
reject(err);
});
if (["path", "stream"].includes(input.inputType)) {
form.pipe(req);
}
if (input.inputType === "base64") {
req.write(body);
req.end();
}
});

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