From 35dd4566a5c6e8c28fa9963f248449e92ca6ae8c Mon Sep 17 00:00:00 2001 From: Jon Jee Date: Tue, 12 Mar 2019 01:03:12 +0900 Subject: [PATCH] Add exception handling when there is no library's name (#103) --- lib.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib.js b/lib.js index f790e80..03b7e7d 100644 --- a/lib.js +++ b/lib.js @@ -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');