Closed phadej closed 10 years ago
Something like:
typify.type("tuple", function (v) { if (!Array.isArray(v)) { return false; } var args = Array.prototype.slice.call(arguments, 1); if (args.length !== v.length) { return false; } for (var i = 0; i < args.length; i++) { if (!args[i](v[i])) return false; } return true; }); typify.check("tuple string number", ["foo", 42]); // true
Something like: