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

Function annotate

packages/effect/src/internal/core.ts:209–222  ·  view source on GitHub ↗
(
    annotations: Context.Context<never>,
    options?: { readonly overwrite?: boolean | undefined }
  )

Source from the content-addressed store, hash-verified

207 }
208
209 annotate(
210 annotations: Context.Context<never>,
211 options?: { readonly overwrite?: boolean | undefined }
212 ): this {
213 if (annotations.mapUnsafe.size === 0) return this
214 const newAnnotations = new Map(this.annotations)
215 annotations.mapUnsafe.forEach((value, key) => {
216 if (options?.overwrite !== true && newAnnotations.has(key)) return
217 newAnnotations.set(key, value)
218 })
219 const self = Object.assign(Object.create(Object.getPrototypeOf(this)), this)
220 self.annotations = newAnnotations
221 return self
222 }
223
224 pipe() {
225 return pipeArguments(this, arguments)

Callers

nothing calls this directly

Calls 4

assignMethod · 0.80
forEachMethod · 0.65
setMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected