const PhoneNumber = pipe(
Schema.NonEmptyTrimmedString,
Schema.transformOrFail(pipe(Schema.String, Schema.brand("Field/PhoneNumber")), {
strict: true,
decode: (i, _, ast) =>
Either.liftPredicate(
i,
() => isValidPhoneNumber(i, "IT"),
() => new ParseResult.Transformation(ast, i, "Transformation", new ParseResult.Type(ast, i))
),
encode: (i) => Either.right(i)
}),
);
const PhoneNumber = pipe(
Schema.NonEmptyTrimmedString,
Schema.transformOrFail(pipe(Schema.String, Schema.brand("Field/PhoneNumber")), {
strict: true,
decode: (i, _, ast) =>
Either.liftPredicate(
i,
() => isValidPhoneNumber(i, "IT"),
() => new ParseResult.Transformation(ast, i, "Transformation", new ParseResult.Type(ast, i))
),
encode: (i) => Either.right(i)
}),
);