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

@alicloud/pop-core

Package Overview
Dependencies
Maintainers
5
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.5.4 to 1.6.0

1

lib/core.d.ts

@@ -41,3 +41,4 @@ // Type definitions for [~THE LIBRARY NAME~] [~OPTIONAL VERSION NUMBER~]

accessKeySecret: string;
opts: object;
}
}

@@ -109,2 +109,4 @@ 'use strict';

}
this.opts = config.opts || {};

@@ -120,3 +122,5 @@ var httpModule = this.endpoint.startsWith('https://')

request(action, params = {}, opts = {}) {
// 1. compose params
// 1. compose params and opts
opts = Object.assign({}, this.opts, opts);
// format action until formatAction is false

@@ -123,0 +127,0 @@ if (opts.formatAction !== false) {

4

lib/roa.js

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

this.host = url.parse(this.endpoint).hostname;
this.opts = config.opts;
var httpModule = this.host.startsWith('https://') ? require('https') : require('http');

@@ -173,3 +173,3 @@ this.keepAliveAgent = new httpModule.Agent({

data: postBody
}, opts);
}, this.opts, opts);

@@ -176,0 +176,0 @@ return httpx.request(url, options).then((response) => {

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

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

@@ -72,3 +72,31 @@ # @alicloud/pop-core

### Custom opts
We offer two ways to customize request opts.
One way is passing opts through the Client constructor. You should treat opts passed through the constructor as default custom opts, because all requests will use this opts.
```js
var client = new RPCClient({
accessKeyId: '<accessKeyId>',
accessKeySecret: '<accessKeySecret>',
endpoint: '<endpoint>',
apiVersion: '<apiVersion>',
opts: {
timeout: 3000
}
});
```
Another way is passing opts through the function's parameter. You should use this way when you want to just pass opts in specific functions.
```js
client.request(action, params, {
timeout: 3000
});
```
When both ways are used, opts will be merged. But for the opt with the same key, the opts provided by the function parameter overrides the opts provided by the constructor.
## License
The MIT License
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