@types/node 18.6.2 → 18.6.3

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.
Files changed (3) hide show
  1. node/README.md +1 -1
  2. node/package.json +2 -2
  3. node/path.d.ts +30 -19
node/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.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 28 Jul 2022 02:32:30 GMT
11
+ * Last updated: Sat, 30 Jul 2022 21:02:20 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.6.2",
3
+ "version": "18.6.3",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "a7df569b45848b5af802c513c0bac5e342b40f2297a1492597939b74c0033e42",
223
+ "typesPublisherContentHash": "a45b99c264e1706eba94977d321e75c5bad5d3e7259ab60aa5a3e4a0926bcb60",
224
224
  "typeScriptVersion": "4.0"
225
225
  }
node/path.d.ts CHANGED
@@ -69,18 +69,19 @@ declare module 'path' {
69
69
  * Normalize a string path, reducing '..' and '.' parts.
70
70
  * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
71
71
  *
72
- * @param p string path to normalize.
72
+ * @param path string path to normalize.
73
+ * @throws {TypeError} if `path` is not a string.
73
74
  */
74
- normalize(p: string): string;
75
+ normalize(path: string): string;
75
76
  /**
76
77
  * Join all arguments together and normalize the resulting path.
77
- * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
78
78
  *
79
79
  * @param paths paths to join.
80
+ * @throws {TypeError} if any of the path segments is not a string.
80
81
  */
81
82
  join(...paths: string[]): string;
82
83
  /**
83
- * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
84
+ * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
84
85
  *
85
86
  * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
86
87
  *
@@ -89,41 +90,50 @@ declare module 'path' {
89
90
  * the current working directory is used as well. The resulting path is normalized,
90
91
  * and trailing slashes are removed unless the path gets resolved to the root directory.
91
92
  *
92
- * @param pathSegments string paths to join. Non-string arguments are ignored.
93
+ * @param paths A sequence of paths or path segments.
94
+ * @throws {TypeError} if any of the arguments is not a string.
93
95
  */
94
- resolve(...pathSegments: string[]): string;
96
+ resolve(...paths: string[]): string;
95
97
  /**
96
98
  * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
97
99
  *
100
+ * If the given {path} is a zero-length string, `false` will be returned.
101
+ *
98
102
  * @param path path to test.
103
+ * @throws {TypeError} if `path` is not a string.
99
104
  */
100
- isAbsolute(p: string): boolean;
105
+ isAbsolute(path: string): boolean;
101
106
  /**
102
- * Solve the relative path from {from} to {to}.
107
+ * Solve the relative path from {from} to {to} based on the current working directory.
103
108
  * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
109
+ *
110
+ * @throws {TypeError} if either `from` or `to` is not a string.
104
111
  */
105
112
  relative(from: string, to: string): string;
106
113
  /**
107
114
  * Return the directory name of a path. Similar to the Unix dirname command.
108
115
  *
109
- * @param p the path to evaluate.
116
+ * @param path the path to evaluate.
117
+ * @throws {TypeError} if `path` is not a string.
110
118
  */
111
- dirname(p: string): string;
119
+ dirname(path: string): string;
112
120
  /**
113
121
  * Return the last portion of a path. Similar to the Unix basename command.
114
122
  * Often used to extract the file name from a fully qualified path.
115
123
  *
116
- * @param p the path to evaluate.
124
+ * @param path the path to evaluate.
117
125
  * @param ext optionally, an extension to remove from the result.
126
+ * @throws {TypeError} if `path` is not a string or if `ext` is given and is not a string.
118
127
  */
119
- basename(p: string, ext?: string): string;
128
+ basename(path: string, ext?: string): string;
120
129
  /**
121
130
  * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
122
- * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
131
+ * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string.
123
132
  *
124
- * @param p the path to evaluate.
133
+ * @param path the path to evaluate.
134
+ * @throws {TypeError} if `path` is not a string.
125
135
  */
126
- extname(p: string): string;
136
+ extname(path: string): string;
127
137
  /**
128
138
  * The platform-specific file separator. '\\' or '/'.
129
139
  */
@@ -135,15 +145,16 @@ declare module 'path' {
135
145
  /**
136
146
  * Returns an object from a path string - the opposite of format().
137
147
  *
138
- * @param pathString path to evaluate.
148
+ * @param path path to evaluate.
149
+ * @throws {TypeError} if `path` is not a string.
139
150
  */
140
- parse(p: string): ParsedPath;
151
+ parse(path: string): ParsedPath;
141
152
  /**
142
153
  * Returns a path string from an object - the opposite of parse().
143
154
  *
144
- * @param pathString path to evaluate.
155
+ * @param pathObject path to evaluate.
145
156
  */
146
- format(pP: FormatInputPathObject): string;
157
+ format(pathObject: FormatInputPathObject): string;
147
158
  /**
148
159
  * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
149
160
  * If path is not a string, path will be returned without modifications.