api-result-transformer

1.1.0 • Public • Published

api-result-transformer

Build Status Coverage Status Code Climate

Transform the results of an api with the transformer functions provided

Install

npm i api-result-transformer

Usage

var apiResultTransformer = require('api-result-transformer');

var floatApi = {
  add: function(a, b) {
    return a + b;
  }
};

var integerApi = apiResultTransformer({
  add: Math.round
}, floatApi);

floatApi.add(Math.PI, 2); // => Math.PI + 2
integerApi.add(Math.PI, 2); // => 5

Readme

Keywords

Package Sidebar

Install

npm i api-result-transformer

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • javiercejudo