( collection: HttpImportCollection, foldersByTag: Map<string, string>, operation: UnknownRecord, )
| 471 | } |
| 472 | |
| 473 | function getFolderId( |
| 474 | collection: HttpImportCollection, |
| 475 | foldersByTag: Map<string, string>, |
| 476 | operation: UnknownRecord, |
| 477 | ): string | null { |
| 478 | const tag = asArray(operation.tags) |
| 479 | .map(asString) |
| 480 | .map(value => value.trim()) |
| 481 | .find(Boolean) |
| 482 | if (!tag) |
| 483 | return null |
| 484 | |
| 485 | const existing = foldersByTag.get(tag) |
| 486 | if (existing) |
| 487 | return existing |
| 488 | |
| 489 | const id = `tag:${tag}` |
| 490 | const folder: HttpImportFolder = { |
| 491 | id, |
| 492 | name: normalizeImportName(tag, 'OpenAPI'), |
| 493 | parentId: null, |
| 494 | } |
| 495 | foldersByTag.set(tag, id) |
| 496 | collection.folders.push(folder) |
| 497 | return id |
| 498 | } |
| 499 | |
| 500 | function parseOperation( |
| 501 | root: UnknownRecord, |
no test coverage detected