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

@alicloud/pop-core

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alicloud/pop-core - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

24

lib/core.js

@@ -72,3 +72,3 @@ 'use strict';

class Core {
constructor(config) {
constructor(config, verbose) {
assert(config, 'must pass "config"');

@@ -88,2 +88,3 @@ assert(config.endpoint, 'must pass "config.endpoint"');

this.secretAccessKey = config.secretAccessKey;
this.verbose = verbose === true;
}

@@ -111,18 +112,31 @@

const url = `${this.endpoint}/?${canonicalize(normalized)}`;
// 4. send request
var entry = {
url: url,
request: null,
response: null
};
// 4. send request
return httpx.request(url).then((response) => {
entry.request = response.req;
entry.response = response;
return httpx.read(response);
}).then((buffer) => {
var json = JSON.parse(buffer);
if (json.Code) {
var err = new Error(json.Message);
err.data = json
err.name = json.Code + 'Error';
err.data = json;
err.code = json.Code;
err.requestid = json.RequestId;
err.url = url;
err.name = json.Code + 'Error';
err.entry = entry;
return Promise.reject(err);
}
if (this.verbose) {
return [json, entry];
}
return json;

@@ -129,0 +143,0 @@ });

{
"name": "@alicloud/pop-core",
"version": "1.0.2",
"version": "1.1.0",
"description": "AliCloud POP SDK core",

@@ -10,3 +10,3 @@ "main": "lib/core.js",

"lint": "eslint --fix lib",
"test-cov": "istanbul cover --report html ./node_modules/.bin/_mocha -- --reporter spec --require co-mocha test/*.test.js"
"test-cov": "istanbul cover --report html ./node_modules/.bin/_mocha -- --require co-mocha --reporter spec test/*.test.js"
},

@@ -13,0 +13,0 @@ "keywords": [

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