1.1.0 • Published 8 years ago
api-result-transformer v1.1.0
api-result-transformer
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