danylokarpenko/backend-project-lvl2

View on GitHub
src/formatters/index.js

Summary

Maintainability
A
0 mins
Test Coverage
import renderToJson from './json';
import renderToPlain from './plain';
import renderToSimple from './simple';

const formats = {
  simple: renderToSimple,
  plain: renderToPlain,
  json: renderToJson,
};

export default (format) => formats[format];