Open TGOlson opened 9 years ago
More or less a simple contract system. AKA, make validators work on arrays.
var validatedFunction = V.validateArgs([isString, isNumber], function(str, n) { // ... })
Works: need to test and prettify errors.
var validateArgs = R.curry(function(schema, f) { return function() { return f.apply(null, V.validateOrThrow(schema, arguments)); }; });
More or less a simple contract system. AKA, make validators work on arrays.