MCPcopy Create free account
hub / github.com/tiann/hapi / hasRuntimeWrapper

Function hasRuntimeWrapper

cli/src/utils/cliArgs.ts:21–35  ·  view source on GitHub ↗
(preArgs: string[], execPath: string, execBase: string, bunMain: string)

Source from the content-addressed store, hash-verified

19}
20
21function hasRuntimeWrapper(preArgs: string[], execPath: string, execBase: string, bunMain: string): boolean {
22 if (preArgs.length === 0) {
23 return false;
24 }
25 if (preArgs[0] === 'bun') {
26 return true;
27 }
28 if (preArgs.length < 2) {
29 return false;
30 }
31 if (preArgs[0] !== execPath && preArgs[0] !== execBase) {
32 return false;
33 }
34 return isEntrypointPath(preArgs[1], bunMain);
35}
36
37export function normalizeCliArgs(rawArgv: string[]): string[] {
38 if (!Array.isArray(rawArgv) || rawArgv.length === 0) {

Callers 1

normalizeCliArgsFunction · 0.85

Calls 1

isEntrypointPathFunction · 0.85

Tested by

no test coverage detected