MCPcopy Index your code
hub / github.com/massCodeIO/massCode / parseUrl

Function parseUrl

src/main/http/import/postman.ts:150–170  ·  view source on GitHub ↗
(rawUrl: unknown)

Source from the content-addressed store, hash-verified

148}
149
150function parseUrl(rawUrl: unknown): {
151 url: string
152 query: HttpImportRequest['query']
153} {
154 if (typeof rawUrl === 'string') {
155 return splitUrlAndQuery(rawUrl)
156 }
157
158 if (!isRecord(rawUrl)) {
159 return { query: [], url: '' }
160 }
161
162 const raw = asString(rawUrl.raw)
163 const parsed = splitUrlAndQuery(raw)
164 const query = parsePostmanQuery(rawUrl)
165
166 return {
167 query: query.length > 0 ? query : parsed.query,
168 url: parsed.url,
169 }
170}
171
172function parseBody(
173 rawBody: unknown,

Callers 1

parseRequestFunction · 0.85

Calls 4

splitUrlAndQueryFunction · 0.90
parsePostmanQueryFunction · 0.85
isRecordFunction · 0.70
asStringFunction · 0.70

Tested by

no test coverage detected