Skip to content

Commit

Permalink
Revert "extract ModuleFormat type"
Browse files Browse the repository at this point in the history
This reverts commit 82f07ba.
  • Loading branch information
pacexy committed Jan 13, 2025
1 parent c277f3f commit f83ea63
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,14 +1108,10 @@ function resolveForCJSWithHooks(specifier, parent, isMain) {
* @typedef {import('internal/modules/customization_hooks').ModuleLoadResult} ModuleLoadResult;
*/

/**
* @typedef {'module'|'commonjs'|'commonjs-typescript'|'module-typescript'|'typescript'} ModuleFormat;
*/

/**
* Load the source code of a module based on format.
* @param {string} filename Filename of the module.
* @param {ModuleFormat|undefined|null} format Format of the module.
* @param {string|undefined|null} format Format of the module.
* @returns {string|null}
*/
function defaultLoadImpl(filename, format) {
Expand Down Expand Up @@ -1686,7 +1682,7 @@ function wrapSafe(filename, content, cjsModuleInstance, format) {
* `exports`) to the file. Returns exception, if any.
* @param {string} content The source code of the module
* @param {string} filename The file path of the module
* @param {ModuleFormat} format Intended format of the module.
* @param {'module'|'commonjs'|'commonjs-typescript'|'module-typescript'|'typescript'} format Intended format of the module.

Check failure on line 1685 in lib/internal/modules/cjs/loader.js

View workflow job for this annotation

GitHub Actions / lint-js-and-md

This line has a length of 124. Maximum allowed is 120
*/
Module.prototype._compile = function(content, filename, format) {
if (format === 'commonjs-typescript' || format === 'module-typescript' || format === 'typescript') {
Expand Down

0 comments on commit f83ea63

Please sign in to comment.