/** * codecs are a way to encode and decode from one type to another * * @module */ import * as Either from "effect/Either"; export type Codec = { decode: (this: This, value: unknown) => Either.Either; encode: (this: This, value: B) => Either.Either; }; export const decodingError = (value: unknown) => new Error(`typeof value ${value} (${typeof value}) could not be decoded`);