nowfound

Life & fun · January 22, 2017

CA

Clause: an expressive JavaScript contract system, inspired by clojure.spec

Clause: an expressive JavaScript contract system, inspired by clojure.spec launched on January 22, 2017 with 8 votes, #1,738 of 3,671 launches that month and more than 75% of that year's launches. The site was still online in September 2026, 9 years on.

What it does

( API docs and the index table are auto-generated with clausejs-docgen . To contribute to API notes & examples, make a pull request to annotation source files here .) To put it plainly, as a developer you expect your data to be of certain "shape". To "conform" your data with your clauses is to shape it in a way that is better organized , making it easier for your code to consume. In order for conformation to work, one must specify a label for each part of your clause definition (example to follow below). var MyCatClause = C.cat( 'first', C.isStr, 'second', C.isNum, 'third', C.isBool ); C.conform( MyCatClause, ["a", 2, true] ) In addition to arrays, strings can also be conformed with scat .…from clause.js.org

Does a similar job

all alternatives →

More life & fun this month

the category →

Source: Show HN post ↗

Launched alongside, January 2017

the whole month →