https://github.com/josdejong/ducktype
- Security fixes in the regular expression for email and url.
- Security fix in the regular expression for urls.
- Implemented types
ducktype.email
,ducktype.integer
,ducktype.url
. - Implemented options
integer
,min
,max
. Only applicable for numbers. - Fixed function
wrap(fn)
which wasn't working.
- Support for creating ducktype arrays containing a fixed number of elements with different types, which can be used for example to test function arguments.
- Ducktype has a new function
wrap(fn)
, which creates a wrapper around the provided function which validates the function arguments against the ducktype. - Some minor internal improvements.
- Added support for structured arrays, like
ducktype([Number])
. - Support for combining types, like
ducktype(Number, String)
. - Added basic types Array, Object, RegExp, null, undefined.
- Created ducktype construction function.
- Basic types Boolean, Date, Function, Number, String
- Object interfaces and nested objects.
Like
ducktype({name: String, Age: Number})
. - Options
nullable
andoptional
.