Ignore:
Timestamp:
11/25/21 22:08:24 (3 years ago)
Author:
Ema <ema_spirova@…>
Branches:
master
Children:
8d391a1
Parents:
59329aa
Message:

primeNG components

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trip-planner-front/node_modules/ignore/index.js

    r59329aa re29cc2e  
    289289
    290290// @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
     291const 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
    307303    ? new RegExp(source, 'i')
    308304    : new RegExp(source)
     
    353349  .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#')
    354350
    355   const regex = makeRegex(pattern, negative, ignorecase)
     351  const regex = makeRegex(pattern, ignorecase)
    356352
    357353  return new IgnoreRule(
     
    401397    ignorecase = true
    402398  } = {}) {
     399    define(this, KEY_IGNORE, true)
     400
    403401    this._rules = []
    404402    this._ignorecase = ignorecase
    405     define(this, KEY_IGNORE, true)
    406403    this._initCache()
    407404  }
Note: See TracChangeset for help on using the changeset viewer.