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

Method constructor

packages/effect/src/SchemaAST.ts:2034–2046  ·  view source on GitHub ↗
(
    parameter: AST,
    type: AST
  )

Source from the content-addressed store, hash-verified

2032 readonly type: AST
2033
2034 constructor(
2035 parameter: AST,
2036 type: AST
2037 ) {
2038 if (!isIndexSignatureParameter(parameter)) {
2039 throw new Error(`Invalid index signature parameter ${parameter._tag}`)
2040 }
2041 this.parameter = parameter
2042 this.type = type
2043 if (isOptional(type) && !containsUndefined(type)) {
2044 throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")
2045 }
2046 }
2047}
2048
2049/**

Callers

nothing calls this directly

Calls 3

isOptionalFunction · 0.85
containsUndefinedFunction · 0.85

Tested by

no test coverage detected