* 解析提交记录为结构化格式 * @param {Array} commits - 提交记录数组 * @returns {Object} 结构化的提交信息
(commits)
| 574 | * @returns {Object} 结构化的提交信息 |
| 575 | */ |
| 576 | static parseCommitsToStructure(commits) { |
| 577 | if (!Array.isArray(commits)) { |
| 578 | logger.warn('Invalid commits format, expected array'); |
| 579 | return this.getEmptyStructure(); |
| 580 | } |
| 581 | |
| 582 | const structure = this.getEmptyStructure(); |
| 583 | |
| 584 | commits.forEach(commit => { |
| 585 | this.categorizeCommit(commit, structure); |
| 586 | }); |
| 587 | |
| 588 | return structure; |
| 589 | } |
| 590 | |
| 591 | /** |
| 592 | * 获取空结构 |
nothing calls this directly
no test coverage detected