@faasjs/request 0.0.3-beta.100 → 0.0.3-beta.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -111,10 +111,6 @@ ___
111
111
 
112
112
  Request
113
113
 
114
- **`Url`**
115
-
116
- https://faasjs.com/doc/request.html
117
-
118
114
  #### Type parameters
119
115
 
120
116
  | Name | Type |
@@ -132,6 +128,10 @@ https://faasjs.com/doc/request.html
132
128
 
133
129
  `Promise`<[`Response`](#response)<`T`\>\>
134
130
 
131
+ **`Url`**
132
+
133
+ https://faasjs.com/doc/request.html
134
+
135
135
  ___
136
136
 
137
137
  ### setMock
@@ -140,12 +140,6 @@ ___
140
140
 
141
141
  Mock requests
142
142
 
143
- **`Example`**
144
-
145
- ```ts
146
- setMock(async (url, options) => Promise.resolve({ headers: {}, statusCode: 200, body: { data: 'ok' } }))
147
- ```
148
-
149
143
  #### Parameters
150
144
 
151
145
  | Name | Type | Description |
@@ -155,3 +149,9 @@ setMock(async (url, options) => Promise.resolve({ headers: {}, statusCode: 200,
155
149
  #### Returns
156
150
 
157
151
  `void`
152
+
153
+ **`Example`**
154
+
155
+ ```ts
156
+ setMock(async (url, options) => Promise.resolve({ headers: {}, statusCode: 200, body: { data: 'ok' } }))
157
+ ```
package/dist/index.js CHANGED
@@ -99,7 +99,7 @@ async function request(url$1, {
99
99
  host: uri.host ? uri.host.replace(/:[0-9]+$/, "") : uri.host,
100
100
  method: method ? method.toUpperCase() : "GET",
101
101
  path: uri.pathname + uri.search,
102
- port: uri.port,
102
+ port: uri.port || (uri.protocol === "https:" ? "443" : "80"),
103
103
  timeout,
104
104
  auth,
105
105
  pfx,
package/dist/index.mjs CHANGED
@@ -76,7 +76,7 @@ async function request(url, {
76
76
  host: uri.host ? uri.host.replace(/:[0-9]+$/, "") : uri.host,
77
77
  method: method ? method.toUpperCase() : "GET",
78
78
  path: uri.pathname + uri.search,
79
- port: uri.port,
79
+ port: uri.port || (uri.protocol === "https:" ? "443" : "80"),
80
80
  timeout,
81
81
  auth,
82
82
  pfx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/request",
3
- "version": "0.0.3-beta.100",
3
+ "version": "0.0.3-beta.101",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "dependencies": {
24
- "@faasjs/logger": "0.0.3-beta.100"
24
+ "@faasjs/logger": "0.0.3-beta.101"
25
25
  },
26
26
  "engines": {
27
27
  "npm": ">=8.0.0",