export const fromSchema = <C extends string, I, A>(
name: C,
schema: Schema.Schema<I, A>
): Config.Config<A> =>
Config.primitive(
name,
flow(
Schema.parseEither(schema),
Either.mapLeft(({ errors }) =>
ConfigError.InvalidData([name], formatErrors(errors))
)
)
);
export const fromSchema = <C extends string, I, A>(
name: C,
schema: Schema.Schema<I, A>
): Config.Config<A> =>
Config.primitive(
name,
flow(
Schema.parseEither(schema),
Either.mapLeft(({ errors }) =>
ConfigError.InvalidData([name], formatErrors(errors))
)
)
);