const nonEmptyString = Schema.compose(
Schema.Trim.annotations({
message: () => "error Trim"
}),
Schema.NonEmptyString.annotations({
message: () => "error NonEmptyString"
})
).annotations({
message: () => "override",
override: true
})
console.log(Schema.decodeUnknownEither(nonEmptyString)(""))
console.log(Schema.decodeUnknownEither(nonEmptyString)(" "))
console.log(Schema.decodeUnknownEither(nonEmptyString)(undefined))
const nonEmptyString = Schema.compose(
Schema.Trim.annotations({
message: () => "error Trim"
}),
Schema.NonEmptyString.annotations({
message: () => "error NonEmptyString"
})
).annotations({
message: () => "override",
override: true
})
console.log(Schema.decodeUnknownEither(nonEmptyString)(""))
console.log(Schema.decodeUnknownEither(nonEmptyString)(" "))
console.log(Schema.decodeUnknownEither(nonEmptyString)(undefined))