Changeset e29cc2e for trip-planner-front/node_modules/ignore/index.js
- Timestamp:
- 11/25/21 22:08:24 (3 years ago)
- Branches:
- master
- Children:
- 8d391a1
- Parents:
- 59329aa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/node_modules/ignore/index.js
r59329aa re29cc2e 289 289 290 290 // @param {pattern} 291 const makeRegex = (pattern, negative, ignorecase) => { 292 const r = regexCache[pattern] 293 if (r) { 294 return r 295 } 296 297 // const replacers = negative 298 // ? NEGATIVE_REPLACERS 299 // : POSITIVE_REPLACERS 300 301 const source = REPLACERS.reduce( 302 (prev, current) => prev.replace(current[0], current[1].bind(pattern)), 303 pattern 304 ) 305 306 return regexCache[pattern] = ignorecase 291 const makeRegex = (pattern, ignorecase) => { 292 let source = regexCache[pattern] 293 294 if (!source) { 295 source = REPLACERS.reduce( 296 (prev, current) => prev.replace(current[0], current[1].bind(pattern)), 297 pattern 298 ) 299 regexCache[pattern] = source 300 } 301 302 return ignorecase 307 303 ? new RegExp(source, 'i') 308 304 : new RegExp(source) … … 353 349 .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#') 354 350 355 const regex = makeRegex(pattern, negative,ignorecase)351 const regex = makeRegex(pattern, ignorecase) 356 352 357 353 return new IgnoreRule( … … 401 397 ignorecase = true 402 398 } = {}) { 399 define(this, KEY_IGNORE, true) 400 403 401 this._rules = [] 404 402 this._ignorecase = ignorecase 405 define(this, KEY_IGNORE, true)406 403 this._initCache() 407 404 }
Note:
See TracChangeset
for help on using the changeset viewer.