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

Function assembleCodec

packages/effect/src/encoding/SchemaBinary.ts:208–218  ·  view source on GitHub ↗
(
  target: Schema.Constraint,
  layout: Layout,
  mode: Mode,
  trusted: Trusted | undefined,
  successOnly = false
)

Source from the content-addressed store, hash-verified

206}
207
208function assembleCodec<S extends Schema.Constraint>(
209 target: Schema.Constraint,
210 layout: Layout,
211 mode: Mode,
212 trusted: Trusted | undefined,
213 successOnly = false
214): toCodec<S> {
215 return (Schema.Uint8Array as Schema.instanceOf<Uint8Array<ArrayBuffer>>).pipe(
216 Schema.decodeTo(target, makeTransformation(layout, mode, trusted, successOnly))
217 ) as unknown as toCodec<S>
218}
219
220/**
221 * Encodes one frame without the schema pass {@link toCodec} wraps around it.

Callers 3

toCodecFunction · 0.85
toCodecStrictFunction · 0.85
toCodecDirectFunction · 0.85

Calls 2

makeTransformationFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected