( headerValue: string, fieldName: string, )
| 523 | } |
| 524 | |
| 525 | function resolveStrictStructuredField( |
| 526 | headerValue: string, |
| 527 | fieldName: string, |
| 528 | ): string { |
| 529 | // Try Dictionary, then List, then Item — the first successful parse wins |
| 530 | try { |
| 531 | return serializeDictionary(parseDictionary(headerValue)); |
| 532 | } catch { /* not a dictionary */ } |
| 533 | try { |
| 534 | return serializeList(parseList(headerValue)); |
| 535 | } catch { /* not a list */ } |
| 536 | try { |
| 537 | return serializeItem(parseItem(headerValue)); |
| 538 | } catch { /* not an item */ } |
| 539 | throw new TypeError( |
| 540 | `Cannot apply "sf" parameter to field "${fieldName}": unknown Structured Field type`, |
| 541 | ); |
| 542 | } |
| 543 | |
| 544 | function resolveDictionaryMember( |
| 545 | headerValue: string, |
no test coverage detected