@@ -25,7 +25,7 @@ const expandRange = (args, options) => {
2525 }
2626
2727 args . sort ( ) ;
28- let value = `[${ args . join ( '-' ) } ]` ;
28+ const value = `[${ args . join ( '-' ) } ]` ;
2929
3030 try {
3131 /* eslint-disable no-new */
@@ -77,18 +77,18 @@ const parse = (input, options) => {
7777
7878 input = REPLACEMENTS [ input ] || input ;
7979
80- let opts = { ...options } ;
81- let max = typeof opts . maxLength === 'number' ? Math . min ( MAX_LENGTH , opts . maxLength ) : MAX_LENGTH ;
82- let len = input . length ;
80+ const opts = { ...options } ;
81+ const max = typeof opts . maxLength === 'number' ? Math . min ( MAX_LENGTH , opts . maxLength ) : MAX_LENGTH ;
82+ const len = input . length ;
8383 if ( len > max ) {
8484 throw new SyntaxError ( `Input length: ${ len } , exceeds maximum allowed length: ${ max } ` ) ;
8585 }
8686
87- let bos = { type : 'bos' , value : '' , output : opts . prepend || '' } ;
88- let tokens = [ bos ] ;
87+ const bos = { type : 'bos' , value : '' , output : opts . prepend || '' } ;
88+ const tokens = [ bos ] ;
8989
90- let capture = opts . capture ? '' : '?:' ;
91- let win32 = utils . isWindows ( options ) ;
90+ const capture = opts . capture ? '' : '?:' ;
91+ const win32 = utils . isWindows ( options ) ;
9292
9393 // create constants based on platform, for windows or posix
9494 const PLATFORM_CHARS = constants . globChars ( win32 ) ;
@@ -113,9 +113,9 @@ const parse = (input, options) => {
113113 return `(${ capture } (?:(?!${ START_ANCHOR } ${ opts . dot ? DOTS_SLASH : DOT_LITERAL } ).)*?)` ;
114114 } ;
115115
116- let nodot = opts . dot ? '' : NO_DOT ;
116+ const nodot = opts . dot ? '' : NO_DOT ;
117117 let star = opts . bash === true ? globstar ( opts ) : STAR ;
118- let qmarkNoDot = opts . dot ? QMARK : QMARK_NO_DOT ;
118+ const qmarkNoDot = opts . dot ? QMARK : QMARK_NO_DOT ;
119119
120120 if ( opts . capture ) {
121121 star = `(${ star } )` ;
@@ -126,7 +126,7 @@ const parse = (input, options) => {
126126 opts . noextglob = opts . noext ;
127127 }
128128
129- let state = {
129+ const state = {
130130 index : - 1 ,
131131 start : 0 ,
132132 consumed : '' ,
@@ -139,8 +139,8 @@ const parse = (input, options) => {
139139 tokens
140140 } ;
141141
142- let extglobs = [ ] ;
143- let stack = [ ] ;
142+ const extglobs = [ ] ;
143+ const stack = [ ] ;
144144 let prev = bos ;
145145 let value ;
146146
@@ -176,8 +176,8 @@ const parse = (input, options) => {
176176
177177 const push = tok => {
178178 if ( prev . type === 'globstar' ) {
179- let isBrace = state . braces > 0 && ( tok . type === 'comma' || tok . type === 'brace' ) ;
180- let isExtglob = extglobs . length && ( tok . type === 'pipe' || tok . type === 'paren' ) ;
179+ const isBrace = state . braces > 0 && ( tok . type === 'comma' || tok . type === 'brace' ) ;
180+ const isExtglob = extglobs . length && ( tok . type === 'pipe' || tok . type === 'paren' ) ;
181181 if ( tok . type !== 'slash' && tok . type !== 'paren' && ! isBrace && ! isExtglob ) {
182182 state . output = state . output . slice ( 0 , - prev . output . length ) ;
183183 prev . type = 'star' ;
@@ -203,12 +203,12 @@ const parse = (input, options) => {
203203 } ;
204204
205205 const extglobOpen = ( type , value ) => {
206- let token = { ...EXTGLOB_CHARS [ value ] , conditions : 1 , inner : '' } ;
206+ const token = { ...EXTGLOB_CHARS [ value ] , conditions : 1 , inner : '' } ;
207207
208208 token . prev = prev ;
209209 token . parens = state . parens ;
210210 token . output = state . output ;
211- let output = ( opts . capture ? '(' : '' ) + token . open ;
211+ const output = ( opts . capture ? '(' : '' ) + token . open ;
212212
213213 push ( { type, value, output : state . output ? '' : ONE_CHAR } ) ;
214214 push ( { type : 'paren' , extglob : true , value : advance ( ) , output } ) ;
@@ -301,7 +301,7 @@ const parse = (input, options) => {
301301 */
302302
303303 if ( value === '\\' ) {
304- let next = peek ( ) ;
304+ const next = peek ( ) ;
305305
306306 if ( next === '/' && opts . bash !== true ) {
307307 continue ;
@@ -841,7 +841,7 @@ const parse = (input, options) => {
841841 continue ;
842842 }
843843
844- let token = { type : 'star' , value, output : star } ;
844+ const token = { type : 'star' , value, output : star } ;
845845
846846 if ( opts . bash === true ) {
847847 token . output = '.*?' ;
@@ -907,7 +907,7 @@ const parse = (input, options) => {
907907 if ( state . backtrack === true ) {
908908 state . output = '' ;
909909
910- for ( let token of state . tokens ) {
910+ for ( const token of state . tokens ) {
911911 state . output += token . output != null ? token . output : token . value ;
912912
913913 if ( token . suffix ) {
@@ -989,10 +989,10 @@ parse.fastpaths = (input, options) => {
989989 return `(?:${ nodot } ${ globstar ( opts ) } ${ SLASH_LITERAL } )?${ DOT_LITERAL } ${ ONE_CHAR } ${ star } ` ;
990990
991991 default : {
992- let match = / ^ ( .* ?) \. ( \w + ) $ / . exec ( str ) ;
992+ const match = / ^ ( .* ?) \. ( \w + ) $ / . exec ( str ) ;
993993 if ( ! match ) return ;
994994
995- let source = create ( match [ 1 ] , options ) ;
995+ const source = create ( match [ 1 ] , options ) ;
996996 if ( ! source ) return ;
997997
998998 return source + DOT_LITERAL + match [ 2 ] ;
0 commit comments