MCPcopy Create free account
hub / github.com/effect-app/libs / allowVoidMake

Function allowVoidMake

packages/effect-app/src/Schema.ts:155–170  ·  view source on GitHub ↗
(schema: any)

Source from the content-addressed store, hash-verified

153): Struct<Fields> {
154 const result = S.Struct(fields).annotate(concurrencyUnbounded)
155 const allowVoidMake = (schema: any): any => {
156 // Normalize omitted input to an empty object so optional/default-only structs can be constructed with make().
157 const origMake: any = schema.make
158 const origMakeOption: any = schema.makeOption
159 const origMakeEffect: any = schema.makeEffect
160 schema.make = function(this: any, input: any, options?: any) {
161 return origMake.call(this, input === undefined ? {} : input, options)
162 }
163 schema.makeOption = function(this: any, input: any, options?: any) {
164 return origMakeOption.call(this, input === undefined ? {} : input, options)
165 }
166 schema.makeEffect = function(this: any, input: any, options?: any) {
167 return origMakeEffect.call(this, input === undefined ? {} : input, options)
168 }
169 return schema
170 }
171 // eslint-disable-next-line @typescript-eslint/unbound-method, @typescript-eslint/no-unsafe-assignment
172 const origMapFields: any = result.mapFields
173 // eslint-disable-next-line @typescript-eslint/unbound-method, @typescript-eslint/no-unsafe-assignment

Callers 2

preserveCopyAndMethodsFunction · 0.85
StructFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…