{"size": 425, "ext": "js", "max_stars_repo_path": "packages/terra-props-table/bin/generateMarkdown/generateProps.js", "max_stars_repo_name": "shinepd/terra-core", "max_stars_repo_stars_event_min_datetime": "2018-05-06T15:29:10.000Z", "max_stars_repo_stars_event_max_datetime": "2018-05-06T15:29:10.000Z", "max_issues_repo_path": "packages/terra-props-table/bin/generateMarkdown/generateProps.js", "max_issues_repo_name": "shinepd/terra-core", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/terra-props-table/bin/generateMarkdown/generateProps.js", "max_forks_repo_name": "shinepd/terra-core", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.3571428571, "max_line_length": 102, "alphanum_fraction": 0.6611764706}
const generatePropRow = require('./generatePropRow');

const generateProps = (props) => {
  const tableHeader = '| Prop Name | Type | Is Required | Default Value | Description |\n';
  const tableHeaderBottom = '|-|-|-|-|-|\n';

  return (
    `${tableHeader}${tableHeaderBottom}${
    Object.keys(props).sort().map(propName => generatePropRow(propName, props[propName])).join('\n')}`
  );
};

module.exports = generateProps;
