urllib 2.37.4 → 2.38.0

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/History.md CHANGED
@@ -1,4 +1,11 @@
1
1
 
2
+ 2.38.0 / 2021-11-24
3
+ ==================
4
+
5
+ **others**
6
+ * [[`6d19f99`](http://github.com/node-modules/urllib/commit/6d19f99f6490df67832d1d2a9c39743c0de1cbd5)] - tsd: add timing interface (#375) (弘树@阿里 <<dickeylth@users.noreply.github.com>>)
7
+ * [[`9c9c65b`](http://github.com/node-modules/urllib/commit/9c9c65b0e8344c1a30c157628a675440b8a616c1)] - test: check TypeScript type definitions (#373) (fengmk2 <<fengmk2@gmail.com>>)
8
+
2
9
  2.37.4 / 2021-09-07
3
10
  ==================
4
11
 
package/README.md CHANGED
@@ -1,21 +1,15 @@
1
1
  # urllib
2
2
 
3
3
  [![NPM version][npm-image]][npm-url]
4
- [![build status][travis-image]][travis-url]
5
- [![Build Status](https://dev.azure.com/eggjs/egg/_apis/build/status/node-modules.urllib)](https://dev.azure.com/eggjs/egg/_build/latest?definitionId=7)
4
+ [![Node.js CI](https://github.com/node-modules/urllib/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/urllib/actions/workflows/nodejs.yml)
6
5
  [![Test coverage][codecov-image]][codecov-url]
7
- [![David deps][david-image]][david-url]
8
6
  [![Known Vulnerabilities][snyk-image]][snyk-url]
9
7
  [![npm download][download-image]][download-url]
10
8
 
11
9
  [npm-image]: https://img.shields.io/npm/v/urllib.svg?style=flat-square
12
10
  [npm-url]: https://npmjs.org/package/urllib
13
- [travis-image]: https://img.shields.io/travis/node-modules/urllib.svg?style=flat-square
14
- [travis-url]: https://travis-ci.org/node-modules/urllib
15
11
  [codecov-image]: https://codecov.io/gh/node-modules/urllib/branch/master/graph/badge.svg
16
12
  [codecov-url]: https://codecov.io/gh/node-modules/urllib
17
- [david-image]: https://img.shields.io/david/node-modules/urllib.svg?style=flat-square
18
- [david-url]: https://david-dm.org/node-modules/urllib
19
13
  [snyk-image]: https://snyk.io/test/npm/urllib/badge.svg?style=flat-square
20
14
  [snyk-url]: https://snyk.io/test/npm/urllib
21
15
  [download-image]: https://img.shields.io/npm/dm/urllib.svg?style=flat-square
package/lib/index.d.ts CHANGED
@@ -140,7 +140,19 @@ export interface HttpClientResponse<T> {
140
140
  data: T;
141
141
  status: number;
142
142
  headers: OutgoingHttpHeaders;
143
- res: http.IncomingMessage;
143
+ res: http.IncomingMessage & {
144
+ /**
145
+ * https://eggjs.org/en/core/httpclient.html#timing-boolean
146
+ */
147
+ timing?: {
148
+ queuing: number;
149
+ dnslookup: number;
150
+ connected: number;
151
+ requestSent: number;
152
+ waiting: number;
153
+ contentDownload: number;
154
+ }
155
+ };
144
156
  }
145
157
 
146
158
 
@@ -0,0 +1,10 @@
1
+ import { expectType } from 'tsd';
2
+ import { curl } from '..';
3
+
4
+ // curl
5
+ expectType<Buffer>((await curl<Buffer>('http://a.com')).data);
6
+ // RequestOptions
7
+ expectType<Buffer>((await curl<Buffer>('http://a.com', {})).data);
8
+ expectType<string>((await curl<string>('http://a.com', {
9
+ method: 'HEAD',
10
+ })).data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "urllib",
3
- "version": "2.37.4",
3
+ "version": "2.38.0",
4
4
  "description": "Help in opening URLs (mostly HTTP) in a complex world — basic and digest authentication, redirections, cookies and more.",
5
5
  "keywords": [
6
6
  "urllib",
@@ -23,10 +23,11 @@
23
23
  "url": "git://github.com/node-modules/urllib.git"
24
24
  },
25
25
  "scripts": {
26
+ "tsd": "node test/tsd.js",
26
27
  "test-local": "mocha -t 30000 -r intelli-espower-loader test/*.test.js",
27
28
  "test": "npm run lint && npm run test-local",
28
29
  "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -t 30000 -r intelli-espower-loader test/*.test.js",
29
- "ci": "npm run lint && npm run test-cov",
30
+ "ci": "npm run lint && npm run tsd && npm run test-cov",
30
31
  "lint": "jshint .",
31
32
  "autod": "autod -w --prefix '^' -t test -e examples",
32
33
  "contributor": "git-contributor"
@@ -73,7 +74,8 @@
73
74
  "spy": "^1.0.0",
74
75
  "tar": "^4.4.8",
75
76
  "through2": "^2.0.3",
76
- "typescript": "^3.2.2"
77
+ "tsd": "^0.18.0",
78
+ "typescript": "^4.4.4"
77
79
  },
78
80
  "engines": {
79
81
  "node": ">= 0.10.0"
@@ -83,7 +85,7 @@
83
85
  "os": {
84
86
  "github": "linux, windows, macos"
85
87
  },
86
- "version": "8, 10, 12, 14"
88
+ "version": "8, 10, 12, 14, 16"
87
89
  },
88
90
  "license": "MIT"
89
91
  }