import * as t from 'io-ts';

export const SampleCustomCodec: t.Type<undefined, undefined, unknown> = new t.Type(
    'SampleCustomCodec',
    (u): u is undefined => u === undefined,
    (u, c) =>
      u === null || u === undefined ? t.success(undefined) : t.failure(u, c),
    () => undefined,
  );
export type SampleCustomCodec = t.TypeOf<typeof SampleCustomCodec>;

export const AnotherSampleCodec = t.number;