MCPcopy
hub / github.com/TypeStrong/ts-node / adjustUseStrict

Function adjustUseStrict

src/repl.ts:549–553  ·  view source on GitHub ↗
(code: string)

Source from the content-addressed store, hash-verified

547
548 // Based on https://github.com/nodejs/node/blob/92573721c7cff104ccb82b6ed3e8aa69c4b27510/lib/repl.js#L457-L461
549 function adjustUseStrict(code: string) {
550 // "void 0" keeps the repl from returning "use strict" as the result
551 // value for statements and declarations that don't return a value.
552 return code.replace(/^"use strict";/, '"use strict"; void 0;');
553 }
554
555 try {
556 output = service.compile(state.input, state.path, -lines);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…