MCPcopy Create free account
hub / github.com/Effect-TS/effect / processAnnotation

Function processAnnotation

packages/effect/src/unstable/httpapi/OpenApi.ts:249–258  ·  view source on GitHub ↗

* 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
)

Source from the content-addressed store, hash-verified

247 * callback function to it. If the tag is not found, the function does nothing.
248 */
249function 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.

Callers 4

fromApiWithFunction · 0.85
onGroupFunction · 0.85
onEndpointFunction · 0.85
makeSecuritySchemeFunction · 0.85

Calls 1

fFunction · 0.50

Tested by

no test coverage detected