(attributes: ExtendedAttributes)
| 76 | } |
| 77 | |
| 78 | function serializeExtendedAttributes(attributes: ExtendedAttributes): Attributes { |
| 79 | const serializedAttributes: Attributes = {} |
| 80 | |
| 81 | for (const [key, value] of Object.entries(attributes)) { |
| 82 | if (value instanceof Error) { |
| 83 | serializedAttributes[key] = String(value) |
| 84 | } else { |
| 85 | serializedAttributes[key] = value |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | return serializedAttributes |
| 90 | } |