Skip to content

Commit 34bf9de

Browse files
committed
fix: accept empty String as issue message
1 parent 2896c30 commit 34bf9de

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module.exports = options => {
9898
const mentionRegexp = buildMentionRegexp(opts);
9999

100100
return text => {
101-
if (!isString(text) || !text.trim()) {
101+
if (!isString(text)) {
102102
throw new TypeError('The issue text must be a String');
103103
}
104104

test/index.test.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,13 @@ test('Empty options', t => {
214214
);
215215
});
216216

217+
test('Empty String', t => {
218+
const empty = {actions: [], duplicates: [], mentions: [], refs: []};
219+
220+
t.deepEqual(m()(' '), empty);
221+
t.deepEqual(m()(''), empty);
222+
});
223+
217224
test('Throw TypeError for invalid options', t => {
218225
t.throws(() => m([]), TypeError);
219226
t.throws(() => m(1), TypeError);
@@ -226,5 +233,4 @@ test('Throw TypeError for invalid input', t => {
226233
t.throws(() => m()(1), TypeError);
227234
t.throws(() => m()({}), TypeError);
228235
t.throws(() => m()([]), TypeError);
229-
t.throws(() => m()(''), TypeError);
230236
});

0 commit comments

Comments
 (0)