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

Function scriptOf

ark/aot/check.ts:394–402  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

392}
393
394const scriptOf = (path: string): string | undefined =>
395 [
396 path,
397 path.replace(/\.([cm]?)js(x?)$/, ".$1ts$2"),
398 ...scriptExtensions.flatMap(extension => [
399 path + extension,
400 resolve(path, `index${extension}`)
401 ])
402 ].find(candidate => statSync(candidate, { throwIfNoEntry: false })?.isFile())
403
404export const countOf = (n: number, noun: string): string =>
405 `${n} ${noun}${n === 1 ? "" : "s"}`

Callers 1

unprunedMessageOfFunction · 0.70

Calls 3

findMethod · 0.80
replaceMethod · 0.80
resolveFunction · 0.70

Tested by

no test coverage detected