MCPcopy Create free account
hub / github.com/Effect-TS/effect / looksLikeFilePath

Function looksLikeFilePath

packages/tools/openapi-generator/src/OpenApiPatch.ts:317–323  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

315 * Heuristic: contains path separators or ends with a known extension.
316 */
317const looksLikeFilePath = (input: string): boolean => {
318 const trimmed = input.trim()
319 if (trimmed.startsWith("[")) return false
320 if (trimmed.includes("/") || trimmed.includes("\\")) return true
321 if (/\.(json|yaml|yml)$/i.test(trimmed)) return true
322 return false
323}
324
325/**
326 * Determine file format from extension.

Callers 1

OpenApiPatch.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected