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

Function looksLikeFilePath

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

Source from the content-addressed store, hash-verified

361 * Heuristic: contains path separators or ends with a known extension.
362 */
363const looksLikeFilePath = (input: string): boolean => {
364 const trimmed = input.trim()
365 if (trimmed.startsWith("[")) return false
366 if (trimmed.includes("/") || trimmed.includes("\\")) return true
367 if (/\.(json|yaml|yml)$/i.test(trimmed)) return true
368 return false
369}
370
371/**
372 * Determine file format from extension.

Callers 1

OpenApiPatch.tsFile · 0.85

Calls 1

trimMethod · 0.80

Tested by

no test coverage detected