/ Return true if entry === baseName.extension
342409
function matches( entry ){

        var len =       baseName.length;
        return entry[len] === "." && !entry.indexOf( baseName ) && entry.slice( len + 1 ).indexOf( "." ) === -1;
    }
1251702
function isSameOrigin(a, b) {
  var urlA = parseURL(a);
  var urlB = parseURL(b);
  if (!urlA || !urlB) {
    return false;
  }
  if (urlA.origin === urlB.origin) {
    return true;
  }
  if (
    urlA.protocol === urlB.protocol &&
    urlA.hostname === urlB.hostname &&
    urlA.port === urlB.port
  ) {
    return true;
  }
  return false;
}
893848
protected boolean tryInstallExtension(ExtensionId extensionId, String namespace)
    {
        DefaultExtensionPlanTree currentTree = this.extensionTree.clone();

        try {
            installExtension(extensionId, namespace, currentTree);

            setExtensionTree(currentTree);

            return true;
        } catch (InstallException e) {
            if (getRequest().isVerbose()) {
                this.logger.info(FAILED_INSTALL_MESSAGE, extensionId, namespace, e);
            } else {
                this.logger.debug(FAILED_INSTALL_MESSAGE, extensionId, namespace, e);
            }
        }

        return false;
    }
141621
public boolean matches(ExtensionId extensionId)
    {
        if (Objects.equal(getId(), extensionId.getId())) {
            if (getVersion() == null || extensionId.getVersion() == null
                || Objects.equal(getVersion(), extensionId.getVersion())) {
                return true;
            }
        }

        return false;
    }
490501
protected boolean isBasename(String potentialPath){
        if (ALLOW_VIEW_NAME_PATH_TRAVERSAL) {
            return true;
        } else {
            if (potentialPath.contains("\\") || potentialPath.contains("/")) {
                // prevent absolute path and folder traversal to find scripts
                return false;
            }
            
            return true;
        }
    }
1357363
function detectExtension() {
  var mimeType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  var favoredExtension = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

  mimeType = mimeType.toString().toLowerCase().replace(/\s/g, '');
  if (!(mimeType in _listTypes.types)) {
    return 'bin';
  }

  if (typeof _listTypes.types[mimeType] === 'string') {
    return _listTypes.types[mimeType];
  }

  favoredExtension = favoredExtension.toString().toLowerCase().replace(/\s/g, '');
  if (favoredExtension && _listTypes.types[mimeType].includes(favoredExtension)) {
    return favoredExtension;
  }

  // search for name match
  var mimePart = mimeType.split('/')[1];
  for (var i = 0, len = _listTypes.types[mimeType].length; i < len; i++) {
    if (mimePart === _listTypes.types[mimeType][i]) {
      return _listTypes.types[mimeType][i];
    }
  }

  // use the first one
  return _listTypes.types[mimeType][0];
}
433091
private function isValidExtension($extension, $base)
	{
		$ext = explode('_', $extension);
		$dir = '';

		switch ($ext[0])
		{
			case 'com':
				$dir = $base . DS . 'components' . DS . $extension;
			break;
			case 'mod':
				$dir = $base . DS . 'modules' . DS . $extension;
			break;
			case 'plg':
				$dir = $base . DS . 'plugins' . DS . $ext[1] . DS . $ext[2];
			break;
			default:
				return false;
			break;
		}

		return (is_dir($dir)) ? true : false;
	}
413037
function match(self, dirname, basename, callback) {
  var pathname, stats, pattern, matches;

  pattern = patternFor(self, basename);
  matches = self.entries(dirname).filter(function(m) { return pattern.test(m); });
  matches = sortMatches(self, matches, basename);

  while (matches.length) {
    pathname  = path.join(dirname, matches.shift());
    stats     = self.stat(pathname);

    if (stats && stats.isFile() && callback(pathname)) {
      return pathname;
    }
  }
}
975919
function tryExtensions(p, exts, isMain) {
  for (var i = 0; i < exts.length; i++) {
    const filename = tryFile(p + exts[i], isMain);

    if (filename) {
      return filename;
    }
  }
  return false;
}
61094
function patternFor(self, basename) {
  if (!has(self.__patterns__, basename)) {
    var pattern;

    var extname = path.extname(basename);

    if (has(self.__aliases__, extname) && self.__aliases__[extname].length) {
      basename = path.basename(basename, extname);
      pattern  = escapeRegexp(basename) +
        '(?:' + [ extname ].concat(self.__aliases__[extname]).map(escapeRegexp).join('|') + ')';
    } else {
      pattern  = escapeRegexp(basename);
    }

    pattern += '(?:' + self.__extensions__.map(escapeRegexp).join('|') + ')*';
    self.__patterns__[basename] = new RegExp('^' + pattern + '$');
  }

  return self.__patterns__[basename];
}
206263
function isValidExtension(src){
   var extension = src.split('.').pop();
   var isValid = ENUM_INVALID_EXTENSIONS[extension] === false ? false : true;
   return isValid;
}
866082
function isFileExtension(filepath, extension) {
			return typeof filepath === 'string' && path.extname(filepath) === extension && fs.existsSync(filepath) &&
				fs.lstatSync(filepath).isFile()
				;
		}
563038
function validateExtensions(input) {
  return new Promise((resolve, reject) => {
    try {
      const extensionPath = getExtensionsPath();

      if (!fs.existsSync(extensionPath)) {
        fs.mkdirSync(extensionPath);
      }

      if (!input.imports.length) {
        return resolve(null);
      }

      return resolve(input);
    } catch (e) {
      return reject(new Error(t('EXTENSION_COULD_NOT_BE_VALIDATED')));
    }
  });
}
435058
private EntryImpl checkOldName(String baseName) {
        EntryImpl e = (EntryImpl) name2entry.get(baseName);
        if (e == null) {
            throw new IllegalArgumentException("Filter not found:" + baseName);
        }
        return e;
    }
1364106
function baseMatchesProperty(path, srcValue) {
      if (isKey(path) && isStrictComparable(srcValue)) {
        return matchesStrictComparable(toKey(path), srcValue);
      }
      return function(object) {
        var objValue = get(object, path);
        return (objValue === undefined$1 && objValue === srcValue)
          ? hasIn(object, path)
          : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
      };
    }
1308495
def Match(self, file_entry):
    
    if not file_entry:
      return False

    filename = file_entry.name.lower()
    return filename == self._filename
775802
def Matches(self, file_entry):
    
    location = getattr(file_entry.path_spec, 'location', None)
    if not location:
      return None

    if '.' not in location:
      return False

    _, _, extension = location.rpartition('.')
    return extension.lower() in self._extensions