{"size": 789, "ext": "js", "max_stars_repo_path": "packages/server/apiSpecification/replikering/udtraek/representations.js", "max_stars_repo_name": "atombrella/Dawa", "max_stars_repo_stars_event_min_datetime": "2015-03-02T13:34:17.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-13T09:34:42.000Z", "max_issues_repo_path": "packages/server/apiSpecification/replikering/udtraek/representations.js", "max_issues_repo_name": "atombrella/Dawa", "max_issues_repo_issues_event_min_datetime": "2015-01-07T12:34:51.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T22:37:30.000Z", "max_forks_repo_path": "packages/server/apiSpecification/replikering/udtraek/representations.js", "max_forks_repo_name": "atombrella/Dawa", "max_forks_repo_forks_event_min_datetime": "2015-08-22T18:49:02.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-18T09:30:15.000Z"}
{"max_stars_count": 46, "max_issues_count": 605, "max_forks_count": 11, "avg_line_length": 35.8636363636, "max_line_length": 97, "alphanum_fraction": 0.7148288973}
"use strict";

const representationUtil = require('../../common/representationUtil');
const fields = require('./fields');
const dbBindings = require('../dbBindings');
const { createRowFormatter} = require('../bindings/util');
module.exports = Object.keys(fields).reduce((memo, datamodelName) => {
  const entityBinding = dbBindings[datamodelName];
  const flatRepresentation = representationUtil.defaultFlatRepresentation(fields[datamodelName]);
  memo[datamodelName] = {
    flat: {
      fields: flatRepresentation.fields,
      outputFields: flatRepresentation.outputFields,
      mapper: baseUrl => createRowFormatter(entityBinding)
    },
    json: {
      fields: flatRepresentation.fields,
      mapper: baseUrl => createRowFormatter(entityBinding)
    }
  };
  return memo;
}, {});