Socket
Socket
Sign inDemoInstall

cc-api-next

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cc-api-next - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

29

index.js

@@ -8,3 +8,3 @@ const fetch = require('isomorphic-unfetch');

this.secret = props.secret;
this.tokenKey = props.tokenKey;
this.tokenKey = props.tokenKey || 'token';
this.headers = {

@@ -48,2 +48,29 @@ "Accept": "application/json",

}
async upload(path, files, data) {
const options = {
method: 'POST',
headers: this.headers
};
delete options.headers['Accept'];
delete options.headers['Content-Type'];
options.body = new FormData();
files.map((file, index) => {
options.body.append(`file[${index}]`, file);
});
for (let key in data) {
options.body.append(key, data[key]);
}
try {
return await fetch(`${this.url}${path}`, options);
} catch (e) {
return e;
}
}
}

@@ -50,0 +77,0 @@

2

package.json
{
"name": "cc-api-next",
"version": "1.0.6",
"version": "1.0.7",
"description": "cc api next",

@@ -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