GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — module: use amaro default transform values · nodejs/node@3cf6457

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/modules
    • helpers.js
  • test
    • es-module
      • test-typescript-transform.mjs
    • fixtures/typescript/cts
      • test-import-require.cts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/modules/helpers.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/helpers.js
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,6 @@ function stripTypeScriptTypes(source, filename) {
359359
mode: typeScriptParsingMode,
360360
sourceMap: sourceMapEnabled,
361361
filename,
362-
// Transform option is only applied in transform mode.
363-
transform: {
364-
verbatimModuleSyntax: true,
365-
},
366362
};
367363
const { code, map } = parse(source, options);
368364
if (map) {
Collapse file

‎test/es-module/test-typescript-transform.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-typescript-transform.mjs
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,15 @@ test('execute a transpiled JavaScript file', async () => {
114114
strictEqual(result.stdout, '');
115115
strictEqual(result.code, 1);
116116
});
117+
118+
test('execute TypeScript file with import = require', async () => {
119+
const result = await spawnPromisified(process.execPath, [
120+
'--experimental-transform-types',
121+
'--no-warnings',
122+
fixtures.path('typescript/cts/test-import-require.cts'),
123+
]);
124+
125+
strictEqual(result.stderr, '');
126+
match(result.stdout, /Hello, TypeScript!/);
127+
strictEqual(result.code, 0);
128+
});
Collapse file

‎test/fixtures/typescript/cts/test-import-require.cts‎

Copy file name to clipboard
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import util = require("node:util");
2+
3+
const foo: string = "Hello, TypeScript!";
4+
5+
console.log(util.styleText(["red"], foo));

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.