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

Function addSymbol

packages/effect/src/internal/schema/toCodeDocument.ts:276–291  ·  view source on GitHub ↗
(symbol: symbol)

Source from the content-addressed store, hash-verified

274 }
275
276 function addSymbol(symbol: symbol): string {
277 const identifier = freshIdentifier("_symbol")
278 const key = globalThis.Symbol.keyFor(symbol)
279 const description = symbol.description
280 artifacts.push({
281 _tag: "Symbol",
282 identifier,
283 code: makeCode(
284 key === undefined
285 ? `Symbol(${description === undefined ? "" : format(description)})`
286 : `Symbol.for(${format(key)})`,
287 `typeof ${identifier}`
288 )
289 })
290 return identifier
291 }
292
293 function annotationSchemas(
294 representation: CheckRepresentationAnnotation | undefined,

Callers 1

onFunction · 0.85

Calls 4

formatFunction · 0.90
freshIdentifierFunction · 0.85
makeCodeFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected