MCPcopy Create free account
hub / github.com/developit/undom / findWhere

Function findWhere

src/util.js:15–19  ·  view source on GitHub ↗
(arr, fn, returnIndex, byValueOnly)

Source from the content-addressed store, hash-verified

13}
14
15export function findWhere(arr, fn, returnIndex, byValueOnly) {
16 let i = arr.length;
17 while (i--) if (typeof fn==='function' && !byValueOnly ? fn(arr[i]) : arr[i]===fn) break;
18 return returnIndex ? i : arr[i];
19}
20
21export function createAttributeFilter(ns, name) {
22 return o => o.ns===ns && toLower(o.name)===toLower(name);

Callers 5

nextSiblingMethod · 0.90
previousSiblingMethod · 0.90
setAttributeNSMethod · 0.90
getAttributeNSMethod · 0.90
spliceFunction · 0.85

Calls 1

fnFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…