Skip to content

Commit c776c7c

Browse files
Trottdanielleadams
authored andcommitted
lib: include return types in JSDoc
Add types to @returns JSDoc annotations where the type is missing. PR-URL: #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 5c1dc5f commit c776c7c

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/internal/blob.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class Blob {
131131
* endings? : string,
132132
* type? : string,
133133
* }} [options]
134-
* @returns
134+
* @constructs {Blob}
135135
*/
136136
constructor(sources = [], options = {}) {
137137
emitExperimentalWarning('buffer.Blob');

lib/internal/fs/utils.js

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ function resolvePackageTarget(packageJSONUrl, target, subpath, packageSubpath,
609609
* @param {Exports} exports
610610
* @param {URL} packageJSONUrl
611611
* @param {string | URL | undefined} base
612-
* @returns
612+
* @returns {boolean}
613613
*/
614614
function isConditionalExportsMainSugar(exports, packageJSONUrl, base) {
615615
if (typeof exports === 'string' || ArrayIsArray(exports)) return true;
@@ -724,7 +724,7 @@ function patternKeyCompare(a, b) {
724724
* @param {string} name
725725
* @param {string | URL | undefined} base
726726
* @param {Set<string>} conditions
727-
* @returns
727+
* @returns {URL}
728728
*/
729729
function packageImportsResolve(name, base, conditions) {
730730
if (name === '#' || StringPrototypeStartsWith(name, '#/')) {

lib/internal/per_context/primordials.js

Lines changed: 1 addition & 1 deletion
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/querystring.js

Lines changed: 1 addition & 1 deletion
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)