homomorphic-js

0.0.2 • Public • Published

Easy way to do Homomorphic Javascript

Build Status Known Vulnerabilities npm version codecov.io Code Climate

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"

Readme

Keywords

Package Sidebar

Install

npm i homomorphic-js

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • algimantas.krasauskas