MCPcopy
hub / github.com/Effect-TS/effect / encodeSymbol

Function encodeSymbol

packages/effect/src/Schema.ts:5446–5453  ·  view source on GitHub ↗
(sym: symbol, ast: AST.AST)

Source from the content-addressed store, hash-verified

5444}) {}
5445
5446const encodeSymbol = (sym: symbol, ast: AST.AST) => {
5447 const key = Symbol.keyFor(sym)
5448 return key === undefined
5449 ? ParseResult.fail(
5450 new ParseResult.Type(ast, sym, `Unable to encode a unique symbol ${String(sym)} into a string`)
5451 )
5452 : ParseResult.succeed(key)
5453}
5454
5455const decodeSymbol = (s: string) => ParseResult.succeed(Symbol.for(s))
5456

Callers 2

Symbol$Class · 0.85
Schema.tsFile · 0.85

Calls 2

StringInterface · 0.85
failMethod · 0.65

Tested by

no test coverage detected