function memoize(type, pattern, options, fn) {
  var key = utils.createKey(type + ':' + pattern, options);
  var disabled = options && options.cache === false;
  if (disabled) {
    braces.clearCache();
    return fn(pattern, options);
  }

  if (cache.hasOwnProperty(key)) {
    return cache[key];
  }

  var res = fn(pattern, options);
  cache[key] = res;
  return res;
}
function memoize(type, pattern, options, fn) {
  var key = utils.createKey(type + ':' + pattern, options);
  var disabled = options && options.cache === false;
  if (disabled) {
    braces.clearCache();
    return fn(pattern, options);
  }

  if (cache.hasOwnProperty(key)) {
    return cache[key];
  }

  var res = fn(pattern, options);
  cache[key] = res;
  return res;
}
function memoize ( type , pattern , options , fn ) { var key = utils . createKey ( type + ':' + pattern , options ) ; var disabled = options && options . cache === false ; if ( disabled ) { braces . clearCache ( ) ; return fn ( pattern , options ) ; } if ( cache . hasOwnProperty ( key ) ) { return cache [ key ] ; } var res = fn ( pattern , options ) ; cache [ key ] = res ; return res ; }
Memoize a generated regex or function. A unique key is generated
from the method name, pattern, and user-defined options. Set
options.memoize to false to disable.
Memoize a generated regex or function . A unique key is generated from the method name pattern and user - defined options . Set options . memoize to false to disable .