MCPcopy
hub / github.com/darkreader/darkreader / isInListOptimized

Function isInListOptimized

src/utils/url.ts:331–341  ·  view source on GitHub ↗
(url: string, list: string[])

Source from the content-addressed store, hash-verified

329const indexedSiteLists = new WeakMap<string[], URLTemplateIndex>();
330
331function isInListOptimized(url: string, list: string[]) {
332 if (!url || list.length === 0) {
333 return false;
334 }
335 let index = indexedSiteLists.get(list);
336 if (!index) {
337 index = indexURLTemplateList(list);
338 indexedSiteLists.set(list, index);
339 }
340 return isURLInIndexedList(url, index);
341}
342
343export function isURLEnabled(url: string, userSettings: UserSettings, {isProtected, isInDarkList, isDarkThemeDetected}: Partial<TabInfo>, isAllowedFileSchemeAccess = true): boolean {
344 if (isLocalFile(url) && !isAllowedFileSchemeAccess) {

Callers 1

isURLEnabledFunction · 0.85

Calls 4

indexURLTemplateListFunction · 0.85
isURLInIndexedListFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected