Skip to content

Commit 88dd972

Browse files
Trottnodejs-github-bot
authored andcommittedDec 12, 2021
lib: include return types in JSDoc
Add types to @returns JSDoc annotations where the type is missing. PR-URL: nodejs#41130 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent c2ff69d commit 88dd972

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed
 

‎lib/internal/blob.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class Blob {
129129
* endings? : string,
130130
* type? : string,
131131
* }} [options]
132-
* @returns
132+
* @constructs {Blob}
133133
*/
134134
constructor(sources = [], options = {}) {
135135
emitExperimentalWarning('buffer.Blob');

‎lib/internal/fs/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ Stats.prototype._checkModeProperty = function(property) {
525525
/**
526526
* @param {Float64Array | BigUint64Array} stats
527527
* @param {number} offset
528-
* @returns
528+
* @returns {BigIntStats | Stats}
529529
*/
530530
function getStatsFromBinding(stats, offset = 0) {
531531
if (isBigUint64Array(stats)) {

‎lib/internal/modules/esm/resolve.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath,
588588
* @param {Exports} exports
589589
* @param {URL} packageJSONUrl
590590
* @param {string | URL | undefined} base
591-
* @returns
591+
* @returns {boolean}
592592
*/
593593
function isConditionalExportsMainSugar(exports, packageJSONUrl, base) {
594594
if (typeof exports === 'string' || ArrayIsArray(exports)) return true;
@@ -701,7 +701,7 @@ function patternKeyCompare(a, b) {
701701
* @param {string} name
702702
* @param {string | URL | undefined} base
703703
* @param {Set<string>} conditions
704-
* @returns
704+
* @returns {URL}
705705
*/
706706
function packageImportsResolve(name, base, conditions) {
707707
if (name === '#' || StringPrototypeStartsWith(name, '#/') ||

‎lib/internal/per_context/primordials.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ primordials.PromisePrototypeCatch = (thisPromise, onRejected) =>
404404
* @param {Promise<any>} thisPromise
405405
* @param {() => void) | undefined | null} onFinally The callback to execute
406406
* when the Promise is settled (fulfilled or rejected).
407-
* @returns A Promise for the completion of the callback.
407+
* @returns {Promise} A Promise for the completion of the callback.
408408
*/
409409
primordials.SafePromisePrototypeFinally = (thisPromise, onFinally) =>
410410
// Wrapping on a new Promise is necessary to not expose the SafePromise

‎lib/internal/webstreams/adapters.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ function newReadableWritablePairFromDuplex(duplex) {
578578
* objectMode? : boolean,
579579
* signal? : AbortSignal,
580580
* }} [options]
581-
* @returns
581+
* @returns {Duplex}
582582
*/
583583
function newStreamDuplexFromReadableWritablePair(pair = {}, options = {}) {
584584
validateObject(pair, 'pair');

‎lib/querystring.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function stringifyPrimitive(v) {
191191
/**
192192
* @param {string | number | bigint | boolean} v
193193
* @param {(v: string) => string} encode
194-
* @returns
194+
* @returns {string}
195195
*/
196196
function encodeStringified(v, encode) {
197197
if (typeof v === 'string')

0 commit comments

Comments
 (0)
Please sign in to comment.