Skip to content

Commit 35dd456

Browse files
committed
Add exception handling when there is no library's name (#103)
1 parent e08c03c commit 35dd456

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ module.exports = ({
4242
license = DEFAULT_LICENSE,
4343
generateExample = DEFAULT_GENERATE_EXAMPLE,
4444
}) => {
45+
if (typeof name !== 'string') {
46+
throw new Error('Please write your library\'s name');
47+
}
48+
4549
if (!overridePrefix) {
4650
if (hasPrefix(name)) {
4751
throw new Error('Please don\'t include the prefix in the name');

0 commit comments

Comments
 (0)