Skip to content

Commit b197239

Browse files
committed
lib: expose tsParse
1 parent a4f609f commit b197239

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/internal/bootstrap/node.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ internalBinding('process_methods').setEmitWarningSync(emitWarningSync);
377377
process.getBuiltinModule = getBuiltinModule;
378378
}
379379

380+
{
381+
const { tsParse } = require('internal/modules/helpers');
382+
process.tsParse = tsParse;
383+
}
384+
380385
function setupProcessObject() {
381386
const EventEmitter = require('events');
382387
const origProcProto = ObjectGetPrototypeOf(process);

test/parallel/test-process-tsparse.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const common = require('../common');
4+
const assert = require('assert');
5+
6+
if (!common.isMainThread)
7+
common.skip('process.tsParse is not available in Workers');
8+
9+
assert.equal(process.tsParse('let s: string'), 'let s ');

0 commit comments

Comments
 (0)