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

Function parseCollection

src/main/http/import/postman.ts:357–376  ·  view source on GitHub ↗
(
  raw: UnknownRecord,
  fileName: string,
  warnings: HttpImportWarning[],
)

Source from the content-addressed store, hash-verified

355}
356
357function parseCollection(
358 raw: UnknownRecord,
359 fileName: string,
360 warnings: HttpImportWarning[],
361): HttpImportCollection {
362 const info = isRecord(raw.info) ? raw.info : {}
363 const name = normalizeImportName(info.name, fileName.replace(/\.json$/i, ''))
364 const auth = parseAuth(raw.auth, fileName, warnings) ?? {
365 type: 'none' as const,
366 }
367 const collection: HttpImportCollection = {
368 description: asString(info.description),
369 folders: [],
370 name,
371 requests: [],
372 }
373
374 walkItems(asArray(raw.item), collection, null, { auth }, name, warnings)
375 return collection
376}
377
378export function parsePostmanFiles(files: HttpImportFile[]): HttpImportResult {
379 const warnings: HttpImportWarning[] = []

Callers 1

parsePostmanFilesFunction · 0.85

Calls 6

normalizeImportNameFunction · 0.90
walkItemsFunction · 0.85
isRecordFunction · 0.70
parseAuthFunction · 0.70
asStringFunction · 0.70
asArrayFunction · 0.70

Tested by

no test coverage detected