debian-mirror-gitlab/app/assets/javascripts/repository/utils/commit.js
2019-12-26 22:10:19 +05:30

13 lines
371 B
JavaScript

// eslint-disable-next-line import/prefer-default-export
export function normalizeData(data, extra = () => {}) {
return data.map(d => ({
sha: d.commit.id,
message: d.commit.message,
committedDate: d.commit.committed_date,
commitPath: d.commit_path,
fileName: d.file_name,
type: d.type,
__typename: 'LogTreeCommit',
...extra(d),
}));
}