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

Function bootstrap

src/bin.ts:78–96  ·  view source on GitHub ↗
(state: BootstrapState)

Source from the content-addressed store, hash-verified

76
77/** @internal */
78export function bootstrap(state: BootstrapState) {
79 if (!state.phase2Result) {
80 state.phase2Result = phase2(state);
81 if (state.shouldUseChildProcess && !state.isInChildProcess) {
82 // Note: When transitioning into the child-process after `phase2`,
83 // the updated working directory needs to be preserved.
84 return callInChild(state);
85 }
86 }
87 if (!state.phase3Result) {
88 state.phase3Result = phase3(state);
89 if (state.shouldUseChildProcess && !state.isInChildProcess) {
90 // Note: When transitioning into the child-process after `phase2`,
91 // the updated working directory needs to be preserved.
92 return callInChild(state);
93 }
94 }
95 return phase4(state);
96}
97
98function parseArgv(argv: string[], entrypointArgs: Record<string, any>) {
99 arg ??= require('arg');

Callers 2

mainFunction · 0.85

Calls 4

callInChildFunction · 0.90
phase2Function · 0.85
phase3Function · 0.85
phase4Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…