Skip to content

Commit 346ae28

Browse files
feat(index): throw error if first argument is not a string
And perform early return if first argument is a blank string
1 parent 5c5fcd4 commit 346ae28

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ var TYPE_DECLARATION = 'declaration';
3030
* @return {Object[]}
3131
*/
3232
module.exports = function(style, options) {
33+
if (typeof style !== 'string') {
34+
throw new TypeError('First argument must be a string');
35+
}
36+
37+
if (!style) return [];
38+
3339
options = options || {};
3440

3541
/**

0 commit comments

Comments
 (0)