Skip to content

Commit

Permalink
lib: expose tsParse
Browse files Browse the repository at this point in the history
  • Loading branch information
stagas committed Aug 7, 2024
1 parent a4f609f commit 19d3296
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/bootstrap/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,9 @@ internalBinding('process_methods').setEmitWarningSync(emitWarningSync);
}

{
const { getBuiltinModule } = require('internal/modules/helpers');
const { getBuiltinModule, tsParse } = require('internal/modules/helpers');
process.getBuiltinModule = getBuiltinModule;
process.tsParse = tsParse;
}

function setupProcessObject() {
Expand Down
9 changes: 9 additions & 0 deletions test/parallel/test-process-tsparse.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

const common = require('../common');
const assert = require('assert');

if (!common.isMainThread)
common.skip('process.tsParse is not available in Workers');

assert.strictEqual(process.tsParse('let s: string'), 'let s ');

0 comments on commit 19d3296

Please sign in to comment.