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

Function projectOwner

packages/effect/src/SchemaAST.ts:4803–4809  ·  view source on GitHub ↗
(ast: A, project: (ast: A) => AST)

Source from the content-addressed store, hash-verified

4801}
4802
4803function projectOwner<A extends AST>(ast: A, project: (ast: A) => AST): A | undefined {
4804 const owner = getContextOwner(ast)
4805 if (owner !== ast) {
4806 const out = project(owner)
4807 return out === owner && !ast.encoding ? ast : replaceContext(out, ast.context) as A
4808 }
4809}
4810
4811function projectType<A extends AST>(ast: A): A {
4812 const owned = projectOwner(ast, stripEncoding)

Callers 2

projectTypeFunction · 0.85
flipASTFunction · 0.85

Calls 3

getContextOwnerFunction · 0.85
replaceContextFunction · 0.85
projectFunction · 0.70

Tested by

no test coverage detected