superstruct icon indicating copy to clipboard operation
superstruct copied to clipboard

Transform type

Open knownasilya opened this issue 4 years ago • 0 comments

Usecase:

email: transform(string(), (value) => value.toLowerCase().trim())
// or
email: string((value) => value.toLowerCase().trim())

I thought I could do it with coerce but that needs a second type. Maybe coerce could work with one type or maybe a separate function makes sense.

knownasilya avatar May 20 '21 21:05 knownasilya