Skip to content

Commit

Permalink
Add exception handling when there is no library's name (frostney#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
738 committed Mar 11, 2019
1 parent e08c03c commit 35dd456
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ module.exports = ({
license = DEFAULT_LICENSE,
generateExample = DEFAULT_GENERATE_EXAMPLE,
}) => {
if (typeof name !== 'string') {
throw new Error('Please write your library\'s name');
}

if (!overridePrefix) {
if (hasPrefix(name)) {
throw new Error('Please don\'t include the prefix in the name');
Expand Down

0 comments on commit 35dd456

Please sign in to comment.