Skip to content

Commit 2abcdb9

Browse files
committed
fix: improve author-email/name-lookup conditionals
1 parent 55fb344 commit 2abcdb9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/finda.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ export class Finda {
4949
if (isString(author) && typeof email === 'undefined') {
5050
email = (author.match(/<[^@]+.+(?=>)/g) || []).join('').substr(1);
5151
}
52-
if (!get(email, 'length')) {
52+
if (get(email, 'length') < 6) {
5353
email = this.gitEmail();
5454
}
55-
if (!get(email, 'length')) {
55+
if (typeof email === 'undefined' || get(email, 'length') < 6) {
5656
email = defaultEmail || `${userInfo().username}@${hostname()}`;
5757
}
5858
return email;
@@ -73,10 +73,10 @@ export class Finda {
7373
if (isString(name)) {
7474
name = trimEnd((name.match(/^[^\<\(]+/g) || []).join(''));
7575
}
76-
if (!get(name, 'length')) {
76+
if (typeof name === 'undefined' || get(name, 'length') < 1) {
7777
name = this.gitName();
7878
}
79-
if (!get(name, 'length')) {
79+
if (typeof name === 'undefined' || get(name, 'length') < 1) {
8080
name = startCase(this.username());
8181
}
8282
return name;

0 commit comments

Comments
 (0)