* Validates that a value can be JSON serialized * @param parser - The parser to use for serialization * @param value - The value to validate for JSON serialization * @param operation - The operation type being performed (for error messages) * @throws Error if the value cannot be JSON serialized
( parser: Parser, value: any, operation: string, )
| 131 | * @throws Error if the value cannot be JSON serialized |
| 132 | */ |
| 133 | function validateJsonSerializable( |
| 134 | parser: Parser, |
| 135 | value: any, |
| 136 | operation: string, |
| 137 | ): void { |
| 138 | try { |
| 139 | parser.stringify(value) |
| 140 | } catch (error) { |
| 141 | throw new SerializationError( |
| 142 | operation, |
| 143 | error instanceof Error ? error.message : String(error), |
| 144 | ) |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Generate a UUID for version tracking |
no outgoing calls
no test coverage detected