{"size": 271, "ext": "js", "max_stars_repo_path": "src/web-vue/src/store/mutations/savePolicy.js", "max_stars_repo_name": "benjie/postgraphile-db-inspector-extension", "max_stars_repo_stars_event_min_datetime": "2019-05-14T04:51:54.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-13T14:51:35.000Z", "max_issues_repo_path": "src/web-vue/src/store/mutations/savePolicy.js", "max_issues_repo_name": "benjie/postgraphile-db-inspector-extension", "max_issues_repo_issues_event_min_datetime": "2019-05-20T22:34:21.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-01T03:10:43.000Z", "max_forks_repo_path": "src/web-vue/src/store/mutations/savePolicy.js", "max_forks_repo_name": "benjie/postgraphile-db-inspector-extension", "max_forks_repo_forks_event_min_datetime": "2019-09-24T18:17:56.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-13T17:52:39.000Z"}
{"max_stars_count": 9, "max_issues_count": 14, "max_forks_count": 2, "avg_line_length": 27.1, "max_line_length": 78, "alphanum_fraction": 0.6494464945}
function savePolicy(state, payload) {
  state.isDirty = true
  const policies = state.policies.filter(p => p.name !== payload.policy.name);
  state.policies = [...policies, ...[payload.policy]].sort((a, b) => {
    return a.id - b.id;
  });
}

export default savePolicy;
