Changelog
v2.2.0
New Feature
added intersection
combinator fix #111
Example
const Min = t.subtype(t.String, function (s) { return s.length > 2; }, 'Min');
const Max = t.subtype(t.String, function (s) { return s.length < 5; }, 'Max');
const MinMax = t.intersection([Min, Max], 'MinMax');
MinMax.is('abc'); // => true
MinMax.is('a'); // => false
MinMax.is('abcde'); // => false
Internal
Changelog
v2.1.0
stringify
function to handle error messages and improve performances in development (replaces the experimental options.verbose
)Changelog
v2.0.1
options.verbose
(default true
) to handle messages (set options.verbose = false
to improve performances in development)Changelog
v2.0.0
is(x, type)
functionisType(x)
functionstringify(x)
function