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

Function getContextOwner

packages/effect/src/SchemaAST.ts:4369–4377  ·  view source on GitHub ↗
(ast: A)

Source from the content-addressed store, hash-verified

4367
4368/** @internal */
4369export function getContextOwner<A extends AST>(ast: A): A {
4370 const existing = bodyOwners.get(ast)
4371 if (existing !== undefined) return existing as A
4372 if (ast.encoding === undefined) return ast
4373 // A body representative must not expose or retain the node's own codec.
4374 const owner = copy(ast, { encoding: undefined })
4375 bodyOwners.set(ast, owner)
4376 return owner
4377}
4378
4379/** @internal */
4380export function replaceEncoding<A extends AST>(ast: A, encoding: Encoding | undefined): A {

Callers 3

copyBodyFunction · 0.85
replaceContextFunction · 0.85
projectOwnerFunction · 0.85

Calls 3

copyFunction · 0.70
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected