debian-mirror-gitlab/app/assets/javascripts/repository/utils/commit.js
2021-03-08 18:12:59 +05:30

14 lines
398 B
JavaScript

export function normalizeData(data, path, extra = () => {}) {
return data.map((d) => ({
sha: d.commit.id,
message: d.commit.message,
titleHtml: d.commit_title_html,
committedDate: d.commit.committed_date,
commitPath: d.commit_path,
fileName: d.file_name,
filePath: `${path}/${d.file_name}`,
type: d.type,
__typename: 'LogTreeCommit',
...extra(d),
}));
}