Skip to content

Commit ab9cabd

Browse files
committed
Merge pull request #8 from bevacqua/patch-1
Null guard
2 parents 983c5bf + 139b8f3 commit ab9cabd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'use strict'
99

1010
module.exports = function hexColorRegex (opts) {
11-
opts = typeof opts === 'object' ? opts : {}
11+
opts = opts && typeof opts === 'object' ? opts : {}
1212

1313
return opts.strict ? /^#([a-f0-9]{6}|[a-f0-9]{3})\b$/i : /#([a-f0-9]{6}|[a-f0-9]{3})\b/gi
1414
}

0 commit comments

Comments
 (0)