silfverorg / duns.js

Javascript schema validator
5 stars 2 forks source link

Rewrite for functional programming #61

Open br0r opened 9 years ago

br0r commented 9 years ago

Now the syntax we use is most often (val, schema)

For this to work well with functional programming shouldn't we change it to (schema, val)?

Example:

//Old way
Duns.assert(val, schema);
//New way
const assertWithSchema = R.curry(Duns.assert)(schema);
assertWithSchema(val);