2.0.0
- Introduce a new module:
idonttrustlikethat/extra
which will contain various non critical validators that I found are still useful in many cases.
The rationale for a new extra
module is that many people are doing import * as v from 'idonttrustlikethat'
but I hope they do import {isoDate} from 'idonttrustlikethat/extra'
and can beneficiate from tree shaking. There's not much to tree shake in the main module as it contain all the JSON validators and utilities around those. Also, extra
is a nice showcase of how easy it is to create new validators from the basic building blocks.
Added new extra validators:
url
absoluteUrl
relativeUrl
minSize
nonEmpty
booleanFromString
numberFromString
intFromString
Breaking changes:
flatMap
is renamed toand
.isoDate
,recursion
andsnakeCaseTransformation
are moved toextra
.withError()
now takes a function with the first argument being the value that we tried to validate.