Skip to content

Commit f0d8743

Browse files
Trottdanielleadams
authored andcommitted
lib,test,tools: use consistent JSDoc types
This could be in preparation of implementing the jsdoc/check-types ESLint rule. PR-URL: #40989 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent e924dc7 commit f0d8743

File tree

10 files changed

+26
-26
lines changed

10 files changed

+26
-26
lines changed

lib/fs.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ function readvSync(fd, buffers, position) {
784784
/**
785785
* Writes `buffer` to the specified `fd` (file descriptor).
786786
* @param {number} fd
787-
* @param {Buffer | TypedArray | DataView | string | Object} buffer
787+
* @param {Buffer | TypedArray | DataView | string | object} buffer
788788
* @param {number} [offset]
789789
* @param {number} [length]
790790
* @param {number} [position]
@@ -849,7 +849,7 @@ ObjectDefineProperty(write, internalUtil.customPromisifyArgs,
849849
* Synchronously writes `buffer` to the
850850
* specified `fd` (file descriptor).
851851
* @param {number} fd
852-
* @param {Buffer | TypedArray | DataView | string | Object} buffer
852+
* @param {Buffer | TypedArray | DataView | string | object} buffer
853853
* @param {number} [offset]
854854
* @param {number} [length]
855855
* @param {number} [position]
@@ -2087,7 +2087,7 @@ function writeAll(fd, isUserFd, buffer, offset, length, signal, callback) {
20872087
/**
20882088
* Asynchronously writes data to the file.
20892089
* @param {string | Buffer | URL | number} path
2090-
* @param {string | Buffer | TypedArray | DataView | Object} data
2090+
* @param {string | Buffer | TypedArray | DataView | object} data
20912091
* @param {{
20922092
* encoding?: string | null;
20932093
* mode?: number;
@@ -2131,7 +2131,7 @@ function writeFile(path, data, options, callback) {
21312131
/**
21322132
* Synchronously writes data to the file.
21332133
* @param {string | Buffer | URL | number} path
2134-
* @param {string | Buffer | TypedArray | DataView | Object} data
2134+
* @param {string | Buffer | TypedArray | DataView | object} data
21352135
* @param {{
21362136
* encoding?: string | null;
21372137
* mode?: number;
@@ -2805,7 +2805,7 @@ function copyFileSync(src, dest, mode) {
28052805
* symlink. The contents of directories will be copied recursively.
28062806
* @param {string | URL} src
28072807
* @param {string | URL} dest
2808-
* @param {Object} [options]
2808+
* @param {object} [options]
28092809
* @param {() => any} callback
28102810
* @returns {void}
28112811
*/
@@ -2827,7 +2827,7 @@ function cp(src, dest, options, callback) {
28272827
* symlink. The contents of directories will be copied recursively.
28282828
* @param {string | URL} src
28292829
* @param {string | URL} dest
2830-
* @param {Object} [options]
2830+
* @param {object} [options]
28312831
* @returns {void}
28322832
*/
28332833
function cpSync(src, dest, options) {

lib/http.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ function createServer(opts, requestListener) {
6060
}
6161

6262
/**
63-
* @typedef {Object} HTTPRequestOptions
63+
* @typedef {object} HTTPRequestOptions
6464
* @property {httpAgent.Agent | boolean} [agent]
6565
* @property {string} [auth]
6666
* @property {Function} [createConnection]
6767
* @property {number} [defaultPort]
6868
* @property {number} [family]
69-
* @property {Object} [headers]
69+
* @property {object} [headers]
7070
* @property {number} [hints]
7171
* @property {string} [host]
7272
* @property {string} [hostname]

lib/internal/errors.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ const captureLargerStackTrace = hideStackFrames(
474474
* The goal is to migrate them to ERR_* errors later when compatibility is
475475
* not a concern.
476476
*
477-
* @param {Object} ctx
477+
* @param {object} ctx
478478
* @returns {Error}
479479
*/
480480
const uvException = hideStackFrames(function uvException(ctx) {

lib/internal/modules/esm/loader.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ class ESMLoader {
5454
/**
5555
* Prior to ESM loading. These are called once before any modules are started.
5656
* @private
57-
* @property {function[]} globalPreloaders First-in-first-out list of
57+
* @property {Function[]} globalPreloaders First-in-first-out list of
5858
* preload hooks.
5959
*/
6060
#globalPreloaders = [];
6161

6262
/**
6363
* Phase 2 of 2 in ESM loading.
6464
* @private
65-
* @property {function[]} loaders First-in-first-out list of loader hooks.
65+
* @property {Function[]} loaders First-in-first-out list of loader hooks.
6666
*/
6767
#loaders = [
6868
defaultLoad,
@@ -71,7 +71,7 @@ class ESMLoader {
7171
/**
7272
* Phase 1 of 2 in ESM loading.
7373
* @private
74-
* @property {function[]} resolvers First-in-first-out list of resolver hooks
74+
* @property {Function[]} resolvers First-in-first-out list of resolver hooks
7575
*/
7676
#resolvers = [
7777
defaultResolve,
@@ -341,8 +341,8 @@ class ESMLoader {
341341
* The internals of this WILL change when chaining is implemented,
342342
* depending on the resolution/consensus from #36954
343343
* @param {string} url The URL/path of the module to be loaded
344-
* @param {Object} context Metadata about the module
345-
* @returns {Object}
344+
* @param {object} context Metadata about the module
345+
* @returns {object}
346346
*/
347347
async load(url, context = {}) {
348348
const defaultLoader = this.#loaders[0];

lib/internal/source_map/source_map.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ class SourceMap {
148148
}
149149

150150
/**
151-
* @return {Object} raw source map v3 payload.
151+
* @return {object} raw source map v3 payload.
152152
*/
153153
get payload() {
154154
return cloneSourceMapV3(this.#payload);

lib/internal/util/inspect.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function getUserOptions(ctx, isCrossContext) {
280280
* in the best way possible given the different types.
281281
*
282282
* @param {any} value The value to print out.
283-
* @param {Object} opts Optional options object that alters the output.
283+
* @param {object} opts Optional options object that alters the output.
284284
*/
285285
/* Legacy: value, showHidden, depth, colors */
286286
function inspect(value, opts) {

lib/v8.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class DefaultSerializer extends Serializer {
269269
/**
270270
* Used to write some kind of host object, i.e. an
271271
* object that is created by native C++ bindings.
272-
* @param {Object} abView
272+
* @param {object} abView
273273
* @returns {void}
274274
*/
275275
_writeHostObject(abView) {

test/async-hooks/hook-checks.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const assert = require('assert');
88
*
99
* @name checkInvocations
1010
* @function
11-
* @param {Object} activity including timestamps for each life time event,
11+
* @param {object} activity including timestamps for each life time event,
1212
* i.e. init, before ...
13-
* @param {Object} hooks the expected life time event invocations with a count
13+
* @param {object} hooks the expected life time event invocations with a count
1414
* indicating how often they should have been invoked,
1515
* i.e. `{ init: 1, before: 2, after: 2 }`
16-
* @param {String} stage the name of the stage in the test at which we are
16+
* @param {string} stage the name of the stage in the test at which we are
1717
* checking the invocations
1818
*/
1919
exports.checkInvocations = function checkInvocations(activity, hooks, stage) {

tools/eslint-rules/require-common-first.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ module.exports = function(context) {
1717

1818
/**
1919
* Function to check if the path is a module and return its name.
20-
* @param {String} str The path to check
21-
* @returns {String} module name
20+
* @param {string} str The path to check
21+
* @returns {string} module name
2222
*/
2323
function getModuleName(str) {
2424
if (str === '../common/index.mjs') {
@@ -32,7 +32,7 @@ module.exports = function(context) {
3232
* Function to check if a node has an argument that is a module and
3333
* return its name.
3434
* @param {ASTNode} node The node to check
35-
* @returns {undefined|String} module name or undefined
35+
* @returns {undefined | string} module name or undefined
3636
*/
3737
function getModuleNameFromCall(node) {
3838
// Node has arguments and first argument is string

tools/eslint-rules/required-modules.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module.exports = function(context) {
2727

2828
/**
2929
* Function to check if the path is a required module and return its name.
30-
* @param {String} str The path to check
31-
* @returns {undefined|String} required module name or undefined
30+
* @param {string} str The path to check
31+
* @returns {undefined | string} required module name or undefined
3232
*/
3333
function getRequiredModuleName(str) {
3434
const match = requiredModules.find(([, test]) => {
@@ -41,7 +41,7 @@ module.exports = function(context) {
4141
* Function to check if a node has an argument that is a required module and
4242
* return its name.
4343
* @param {ASTNode} node The node to check
44-
* @returns {undefined|String} required module name or undefined
44+
* @returns {undefined | string} required module name or undefined
4545
*/
4646
function getRequiredModuleNameFromCall(node) {
4747
// Node has arguments and first argument is string

0 commit comments

Comments
 (0)