MCPcopy Create free account
hub / github.com/arktypeio/arktype / isMain

Function isMain

ark/type/cli.ts:915–923  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

913}
914
915const isMain = (): boolean => {
916 const entry = process.argv[1]
917 if (!entry) return false
918 try {
919 return realpathSync(entry) === realpathSync(fileURLToPath(import.meta.url))
920 } catch {
921 return false
922 }
923}
924
925if (isMain()) process.exit(runCli(process.argv.slice(2)))

Callers 1

cli.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected