Skip to content

Commit

Permalink
more jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
timfish committed Jul 29, 2024
1 parent 75c2103 commit 7f430e4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ function isBareSpecifier (specifier) {
}
}

/**
* Determines whether the input is a bare specifier, file URL or a regular expression.
*
* - node: prefixed URL strings are considered bare specifiers in this context.
*/
function isBareSpecifierFileUrlOrRegex (input) {
if (input instanceof RegExp) {
return true
Expand All @@ -140,6 +145,13 @@ function isBareSpecifierFileUrlOrRegex (input) {
}
}

/**
* Ensure an array only contains bare specifiers, file URLs or regular expressions.
*
* - We consider node: prefixed URL string as bare specifiers in this context.
* - For node built-in modules, we add additional node: prefixed modules to the
* output array.
*/
function ensureArrayWithBareSpecifiersFileUrlsAndRegex (array, type) {
if (!Array.isArray(array)) {
return undefined
Expand Down

0 comments on commit 7f430e4

Please sign in to comment.