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

Function makeStruct

repos/effect/packages/effect/src/Schema.ts:3348–3362  ·  view source on GitHub ↗
(ast: SchemaAST.Objects, fields: Fields)

Source from the content-addressed store, hash-verified

3346 f: (fields: Fields) => To,
3347 options?: {
3348 readonly unsafePreserveChecks?: boolean | undefined
3349 } | undefined
3350 ): Struct<Simplify<Readonly<To>>>
3351}
3352
3353function makeStruct<const Fields extends Struct.Fields>(ast: SchemaAST.Objects, fields: Fields): Struct<Fields> {
3354 return make(ast, {
3355 fields,
3356 mapFields<To extends Struct.Fields>(
3357 this: Struct<Fields>,
3358 f: (fields: Fields) => To,
3359 options?: {
3360 readonly unsafePreserveChecks?: boolean | undefined
3361 } | undefined
3362 ): Struct<To> {
3363 const fields = f(this.fields)
3364 return makeStruct(SchemaAST.struct(fields, options?.unsafePreserveChecks ? this.ast.checks : undefined), fields)
3365 }

Callers 3

mapFieldsFunction · 0.85
StructFunction · 0.85
extendMethod · 0.85

Calls 1

makeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…