bool isValid(String profileName, String link) { var matches = profiles[profileName]; return findIndexFromLink(matches, trim(link), config) != -1; }