* 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>, tag: Context.Tag<I, S>, f: (s: S) => void )
| 165 | * callback function to it. If the tag is not found, the function does nothing. |
| 166 | */ |
| 167 | function processAnnotation<Services, S, I>( |
| 168 | ctx: Context.Context<Services>, |
| 169 | tag: Context.Tag<I, S>, |
| 170 | f: (s: S) => void |
| 171 | ) { |
| 172 | const o = Context.getOption(ctx, tag) |
| 173 | if (Option.isSome(o)) { |
| 174 | f(o.value) |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | /** |
| 179 | * @since 1.0.0 |
no test coverage detected
searching dependent graphs…