Files
tsgo/testdata/baselines/reference/submodule/conformance/nodeModulesTopLevelAwait(module=node16).js
be5de2a808 Fix declaration emit to remove non-JSDoc comments while preserving JSDoc (#1752)
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: jakebailey <[email protected]>
2025-09-26 02:23:32 +00:00

45 lines
831 B
TypeScript

//// [tests/cases/conformance/node/nodeModulesTopLevelAwait.ts] ////
//// [index.ts]
// cjs format file
const x = await 1;
export {x};
for await (const y of []) {}
//// [index.ts]
// esm format file
const x = await 1;
export {x};
for await (const y of []) {}
//// [package.json]
{
"name": "package",
"private": true,
"type": "module"
}
//// [package.json]
{
"type": "commonjs"
}
//// [index.js]
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.x = void 0;
// cjs format file
const x = await 1;
exports.x = x;
for await (const y of []) { }
//// [index.js]
// esm format file
const x = await 1;
export { x };
for await (const y of []) { }
//// [index.d.ts]
declare const x = 1;
export { x };
//// [index.d.ts]
declare const x = 1;
export { x };