File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import zlib from 'zlib';
3
3
import fs from 'fs' ;
4
4
import path from 'path' ;
5
5
import lod from 'lodash' ;
6
- import { CommitContent } from '../types' ;
6
+ import { CommitContent , PersonLine } from '../types' ;
7
7
import {
8
8
BRANCH_PREFIX ,
9
9
EMPTY_COMMIT_HASH ,
@@ -108,7 +108,7 @@ async function exec(req: any, action: Action): Promise<Action> {
108
108
* @param {string } line - The line to parse.
109
109
* @return {Object } An object containing the name, email, and timestamp.
110
110
*/
111
- const parsePersonLine = ( line : string ) : { name : string ; email : string ; timestamp : string } | null => {
111
+ const parsePersonLine = ( line : string ) : PersonLine => {
112
112
const personRegex = / ^ ( .* ?) < ( .* ?) > ( \d + ) ( [ + - ] \d + ) $ / ;
113
113
const match = line . match ( personRegex ) ;
114
114
if ( ! match ) {
@@ -126,8 +126,8 @@ const getParsedData = (headerLines: string[]) => {
126
126
const parsedData : {
127
127
tree ?: string ;
128
128
parents : string [ ] ;
129
- authorInfo ?: ReturnType < typeof parsePersonLine > ;
130
- committerInfo ?: ReturnType < typeof parsePersonLine > ;
129
+ authorInfo ?: PersonLine ;
130
+ committerInfo ?: PersonLine ;
131
131
} = { parents : [ ] } ;
132
132
133
133
for ( const line of headerLines ) {
Original file line number Diff line number Diff line change @@ -18,3 +18,9 @@ export type CommitContent = {
18
18
objectRef : any ;
19
19
content : string ;
20
20
}
21
+
22
+ export type PersonLine = {
23
+ name : string ;
24
+ email : string ;
25
+ timestamp : string ;
26
+ }
You can’t perform that action at this time.
0 commit comments