From ada7d82b162a4834ca587d968cd5c22f76f6d7db Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 4 Oct 2022 20:04:52 -0700 Subject: [PATCH] lib: require JSDoc in internal validators code Closes: https://github.com/nodejs/node/issues/44893 PR-URL: https://github.com/nodejs/node/pull/44896 Fixes: https://github.com/nodejs/node/issues/44893 Reviewed-By: Zeyu "Alex" Yang Reviewed-By: Luigi Pinca --- lib/internal/validators.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/internal/validators.js b/lib/internal/validators.js index dae0f9bc056b3b..4ed1e1115a9448 100644 --- a/lib/internal/validators.js +++ b/lib/internal/validators.js @@ -1,3 +1,5 @@ +/* eslint jsdoc/require-jsdoc: "error" */ + 'use strict'; const { @@ -217,6 +219,12 @@ function validateBoolean(value, name) { throw new ERR_INVALID_ARG_TYPE(name, 'boolean', value); } +/** + * @param {?object} options + * @param {string} key + * @param {boolean} defaultValue + * @returns {boolean} + */ function getOwnPropertyValueOrDefault(options, key, defaultValue) { return options == null || !ObjectPrototypeHasOwnProperty(options, key) ? defaultValue :