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

Function updateContext

packages/effect/src/SchemaAST.ts:4528–4536  ·  view source on GitHub ↗
(
  ast: A,
  optional = isOptional(ast),
  mutable = isMutable(ast),
  constructorDefault = ast.context?.constructorDefault,
  annotations = ast.context?.annotations
)

Source from the content-addressed store, hash-verified

4526}
4527
4528function updateContext<A extends AST>(
4529 ast: A,
4530 optional = isOptional(ast),
4531 mutable = isMutable(ast),
4532 constructorDefault = ast.context?.constructorDefault,
4533 annotations = ast.context?.annotations
4534): A {
4535 return replaceContext(ast, new Context(optional, mutable, constructorDefault, annotations))
4536}
4537
4538function setContextFlag(key: "isOptional" | "isMutable") {
4539 const optional = key === "isOptional" ? true : undefined

Callers 7

setContextFlagFunction · 0.85
annotateKeyFunction · 0.85
withConstructorDefaultFunction · 0.85
Channel.tsFile · 0.85
Stream.tsFile · 0.85
effect.tsFile · 0.85
provideServiceImplFunction · 0.85

Calls 3

isMutableFunction · 0.85
replaceContextFunction · 0.85
isOptionalFunction · 0.70

Tested by

no test coverage detected