{"size": 501, "ext": "js", "max_stars_repo_path": "src/Cytoscape/layouts/layoutConfigToObject.js", "max_stars_repo_name": "martineian/act-frontend", "max_stars_repo_stars_event_min_datetime": "2019-09-16T20:34:10.000Z", "max_stars_repo_stars_event_max_datetime": "2021-03-11T11:36:32.000Z", "max_issues_repo_path": "src/Cytoscape/layouts/layoutConfigToObject.js", "max_issues_repo_name": "martineian/act-frontend", "max_issues_repo_issues_event_min_datetime": "2019-02-22T13:41:19.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-03T11:55:14.000Z", "max_forks_repo_path": "src/Cytoscape/layouts/layoutConfigToObject.js", "max_forks_repo_name": "martineian/act-frontend", "max_forks_repo_forks_event_min_datetime": "2019-02-22T21:32:57.000Z", "max_forks_repo_forks_event_max_datetime": "2021-06-14T13:28:00.000Z"}
{"max_stars_count": 6, "max_issues_count": 30, "max_forks_count": 4, "avg_line_length": 33.4, "max_line_length": 87, "alphanum_fraction": 0.6107784431}
import types from './types';

export default ({ layoutName, layoutConfig }) => {
  const options = Object.keys(layoutConfig).map(optionName => {
    const { type, value } = layoutConfig[optionName];
    if (type === types.func || type === types.funcNumber || type === types.funcRange) {
      // eslint-disable-next-line no-eval
      return { [optionName]: eval(value) };
    } else {
      return { [optionName]: value };
    }
  });
  return Object.assign({}, ...options, { name: layoutName });
};
