Skip to content

Commit 19fbc54

Browse files
committed
refactor(util): createMessage validate empty type
1 parent c3fdcb1 commit 19fbc54

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/utils.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import Emoji from './emoji';
33
const isSuccess = type => type === 'success';
44

55
const createMessage = (type, message) => {
6-
const emoji = Emoji.getEmoji(type);
7-
return `${emoji} ${message}`;
6+
if (type) {
7+
const emoji = Emoji.getEmoji(type);
8+
return `${emoji} ${message}`;
9+
}
10+
return message;
811
}
912

1013
export const intercept = (type, ...args) => {

0 commit comments

Comments
 (0)