* This function checks if a given tag exists within the provided context. If * the tag is present, it retrieves the associated value and applies the given * callback function to it. If the tag is not found, the function does nothing.
( ctx: Context.Context<Services>, annotation: Context.Key<I, S>, f: (s: S) => void )
| 247 | * callback function to it. If the tag is not found, the function does nothing. |
| 248 | */ |
| 249 | function processAnnotation<Services, S, I>( |
| 250 | ctx: Context.Context<Services>, |
| 251 | annotation: Context.Key<I, S>, |
| 252 | f: (s: S) => void |
| 253 | ) { |
| 254 | const o = Context.getOption(ctx, annotation) |
| 255 | if (Option.isSome(o)) { |
| 256 | f(o.value) |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * Converts an `HttpApi` instance into an OpenAPI Specification object. |
no test coverage detected