Skip to content

Commit c4ea796

Browse files
committed
esm: improve JSDoc annotation of internal functions
Co-authored-by: Geoffrey Booth <[email protected]>
1 parent 092fb9f commit c4ea796

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/internal/modules/run_main.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function resolveMainPath(main) {
3030

3131
/**
3232
* Determine whether the main entry point should be loaded through the ESM Loader.
33-
* @param {string} mainPath Absolute path to the main entry point
33+
* @param {string} mainPath - Absolute path to the main entry point
3434
*/
3535
function shouldUseESMLoader(mainPath) {
3636
/**
@@ -57,7 +57,7 @@ function shouldUseESMLoader(mainPath) {
5757

5858
/**
5959
* Run the main entry point through the ESM Loader.
60-
* @param {string} mainPath Absolute path to the main entry point
60+
* @param {string} mainPath - Absolute path for the main entry point
6161
*/
6262
function runMainESM(mainPath) {
6363
const { loadESM } = require('internal/process/esm_loader');
@@ -72,7 +72,7 @@ function runMainESM(mainPath) {
7272

7373
/**
7474
* Handle process exit events around the main entry point promise.
75-
* @param {Promise} promise Main entry point promise
75+
* @param {Promise} promise - Main entry point promise
7676
*/
7777
async function handleMainPromise(promise) {
7878
const {
@@ -90,7 +90,8 @@ async function handleMainPromise(promise) {
9090
* Parse the CLI main entry point string and run it.
9191
* For backwards compatibility, we have to run a bunch of monkey-patchable code that belongs to the CJS loader (exposed
9292
* by `require('module')`) even when the entry point is ESM.
93-
* @param {string} main CLI main entry point string
93+
* Because of backwards compatibility, this function is exposed publicly via `import { runMain } from 'node:module'`.
94+
* @param {string} main - Resolved absolute path for the main entry point, if found
9495
*/
9596
function executeUserEntryPoint(main = process.argv[1]) {
9697
const resolvedMain = resolveMainPath(main);

0 commit comments

Comments
 (0)