File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { buildRegExp } from '../builders';
22import { endOfString , startOfString } from '../constructs/anchors' ;
33import { charClass , charRange , digit } from '../constructs/character-class' ;
44import { choiceOf } from '../constructs/choice-of' ;
5- import { optional } from '../constructs/quantifiers' ;
65import { repeat } from '../constructs/repeat' ;
76
87const hexDigit = charClass ( digit , charRange ( 'a' , 'f' ) ) ;
@@ -22,19 +21,17 @@ export const hexColorFinder = buildRegExp(
2221/**
2322 * Check that given text is a valid hex color.
2423 *
25- * Allows both 3 and 6 digit hex colors, with or without the leading `#` .
24+ * Allows both 3 and 6 digit hex colors.
2625 * */
2726export const hexColorValidator = buildRegExp (
2827 [
2928 startOfString , // Match whole string
30- optional ( '#' ) ,
29+ '#' ,
3130 choiceOf (
3231 repeat ( hexDigit , 6 ) , // #rrggbb
3332 repeat ( hexDigit , 3 ) , // #rgb
3433 ) ,
3534 endOfString ,
3635 ] ,
37- {
38- ignoreCase : true ,
39- } ,
36+ { ignoreCase : true } ,
4037) ;
You can’t perform that action at this time.
0 commit comments