2019-12-26 22:10:19 +05:30
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
2020-01-01 13:55:28 +05:30
|
|
|
export function normalizeData(data, path, extra = () => {}) {
|
2019-12-26 22:10:19 +05:30
|
|
|
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,
|
2020-01-01 13:55:28 +05:30
|
|
|
filePath: `${path}/${d.file_name}`,
|
2019-12-26 22:10:19 +05:30
|
|
|
type: d.type,
|
|
|
|
__typename: 'LogTreeCommit',
|
|
|
|
...extra(d),
|
|
|
|
}));
|
|
|
|
}
|