@types/node 14.18.43 → 14.18.44

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.
node v14.18/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v14.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Tue, 25 Apr 2023 21:32:51 GMT
11
+ * Last updated: Thu, 04 May 2023 21:02:47 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.18.43",
3
+ "version": "14.18.44",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "8247fa851a10ad4b2d18280b19a1df533acc846694864a41219ddea760fb6ec3",
230
+ "typesPublisherContentHash": "b3d9782bb86f7925feec5f65267eec93e6090678ea0827575e5be631a5ef702d",
231
231
  "typeScriptVersion": "4.3"
232
232
  }
@@ -1,4 +1,5 @@
1
1
  declare module 'url' {
2
+ import { ClientRequestArgs } from 'node:http';
2
3
  import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
3
4
 
4
5
  // Input to `url.format`
@@ -71,6 +72,33 @@ declare module 'url' {
71
72
  * @param url The path to convert to a File URL.
72
73
  */
73
74
  function pathToFileURL(url: string): URL;
75
+ /**
76
+ * This utility function converts a URL object into an ordinary options object as
77
+ * expected by the `http.request()` and `https.request()` APIs.
78
+ *
79
+ * ```js
80
+ * import { urlToHttpOptions } from 'url';
81
+ * const myURL = new URL('https://a:b@測試?abc#foo');
82
+ *
83
+ * console.log(urlToHttpOptions(myURL));
84
+ *
85
+ * {
86
+ * protocol: 'https:',
87
+ * hostname: 'xn--g6w251d',
88
+ * hash: '#foo',
89
+ * search: '?abc',
90
+ * pathname: '/',
91
+ * path: '/?abc',
92
+ * href: 'https://a:b@xn--g6w251d/?abc#foo',
93
+ * auth: 'a:b'
94
+ * }
95
+ *
96
+ * ```
97
+ * @since v14.18.0
98
+ * @param url The `WHATWG URL` object to convert to an options object.
99
+ * @return Options object
100
+ */
101
+ function urlToHttpOptions(url: URL): ClientRequestArgs;
74
102
 
75
103
  interface URLFormatOptions {
76
104
  auth?: boolean | undefined;
node v14.18/url.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare module 'url' {
2
+ import { ClientRequestArgs } from 'node:http';
2
3
  import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
3
4
 
4
5
  // Input to `url.format`
@@ -71,6 +72,33 @@ declare module 'url' {
71
72
  * @param url The path to convert to a File URL.
72
73
  */
73
74
  function pathToFileURL(url: string): URL;
75
+ /**
76
+ * This utility function converts a URL object into an ordinary options object as
77
+ * expected by the `http.request()` and `https.request()` APIs.
78
+ *
79
+ * ```js
80
+ * import { urlToHttpOptions } from 'url';
81
+ * const myURL = new URL('https://a:b@測試?abc#foo');
82
+ *
83
+ * console.log(urlToHttpOptions(myURL));
84
+ *
85
+ * {
86
+ * protocol: 'https:',
87
+ * hostname: 'xn--g6w251d',
88
+ * hash: '#foo',
89
+ * search: '?abc',
90
+ * pathname: '/',
91
+ * path: '/?abc',
92
+ * href: 'https://a:b@xn--g6w251d/?abc#foo',
93
+ * auth: 'a:b'
94
+ * }
95
+ *
96
+ * ```
97
+ * @since v14.18.0
98
+ * @param url The `WHATWG URL` object to convert to an options object.
99
+ * @return Options object
100
+ */
101
+ function urlToHttpOptions(url: URL): ClientRequestArgs;
74
102
 
75
103
  interface URLFormatOptions {
76
104
  auth?: boolean | undefined;