homomorphic-js
v0.0.2
Published
Easy way to make Js Homomorphic
Downloads
1
Readme
Easy way to do Homomorphic Javascript
This library exports a homoMorph method, that let's you wrap your functions in type checks
var types = homomorphicJs.types;
var sumToString = homomorphicJs.homoMorph(types.num, types.num, types.str)(function(nr1, nr2){
return (nr1 + nr2).toString();
});
sumToString(1,2); // String "3"
sumToString(1, "2"); // TypeError "number expected, string given"