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

Function processPath

packages/tools/openapi-generator/src/OpenApiGenerator.ts:1246–1258  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1244)
1245
1246const processPath = (path: string): {
1247 readonly pathIds: Array<string>
1248 readonly pathTemplate: string
1249} => {
1250 const pathIds: Array<string> = []
1251 path = path.replace(/{([^}]+)}/g, (_, name) => {
1252 const id = Utils.camelize(name)
1253 pathIds.push(id)
1254 return "${" + id + "}"
1255 })
1256 const pathTemplate = "`" + path + "`"
1257 return { pathIds, pathTemplate } as const
1258}

Callers 1

parseOpenApiFunction · 0.85

Calls 2

pushMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected