JavaScript Code Contract Libraries?
问题 I am just starting up a new web application and I want to implement some form of contract'esque style validation in my JavaScript. I did some quick googling, and came across JsContact but the syntax isn't quite what I had in mind. Is anyone aware of other libraries? I am thinking I want the syntax to be something like String.prototype.padLeft = function(c, width) { Verify.value(c).isRequired().isNotNull().isChar(); Verify.value(width).isRequired().isNotNull().isNumber().greaterThan(0); ...