Skip to content

Commit

Permalink
lib: require JSDoc in internal validators code
Browse files Browse the repository at this point in the history
Closes: #44893
  • Loading branch information
Trott committed Oct 5, 2022
1 parent e84e2e6 commit 1f6893e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/internal/validators.js
@@ -1,3 +1,5 @@
/* eslint jsdoc/require-jsdoc: "error" */

'use strict';

const {
Expand Down Expand Up @@ -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 :
Expand Down Expand Up @@ -403,6 +411,10 @@ function validateUnion(value, name, union) {
}
}

/**
* @param {*} value
* @param {string} name
*/
function validateLinkHeaderValue(value, name) {
const linkValueRegExp = /^(?:<[^>]*>;)\s*(?:rel=(")?[^;"]*\1;?)\s*(?:(?:as|anchor|title)=(")?[^;"]*\2)?$/;

Expand Down

0 comments on commit 1f6893e

Please sign in to comment.