Helper object to collect diagnostics from function following the diagnostics accessor pattern(foo() => [T, Diagnostic[]])
Property | Modifier | Type |
---|
diagnostics | readonly | readonly Diagnostic [] |
Add a diagnostic to the collection
Parameter | Type | Description |
---|
diagnostic | Diagnostic | Diagnostic to add. |
void
join<T>(result): DiagnosticResult<T>;
Join the given result with the diagnostics in this collector.
Parameter | Type | Description |
---|
result | DiagnosticResult <T > | result to join with the diagnostics |
DiagnosticResult
<T
>
- the result with the combined diagnostics
Unwrap the Diagnostic result, add all the diagnostics and return the data.
T
wrap<T>(value): DiagnosticResult<T>;
Wrap the given value in a tuple including the diagnostics following the TypeSpec accessor pattern.
Parameter | Type | Description |
---|
value | T | Accessor value to return |
DiagnosticResult
<T
>
return diagnostics.wrap(routes);