(envelope: E, newItem: E[1][number])
| 35 | * so that the envelope types resolve correctly. |
| 36 | */ |
| 37 | export function addItemToEnvelope<E extends Envelope>(envelope: E, newItem: E[1][number]): E { |
| 38 | const [headers, items] = envelope; |
| 39 | return [headers, [...items, newItem]] as unknown as E; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Convenience function to loop through the items and item types of an envelope. |
no outgoing calls
no test coverage detected