MCPcopy Index your code
hub / github.com/jashkenas/underscore / findKey

Function findKey

underscore-node-f.cjs:1260–1267  ·  view source on GitHub ↗
(obj, predicate, context)

Source from the content-addressed store, hash-verified

1258
1259// Returns the first key on an object that passes a truth test.
1260function findKey(obj, predicate, context) {
1261 predicate = cb(predicate, context);
1262 var _keys = keys(obj), key;
1263 for (var i = 0, length = _keys.length; i < length; i++) {
1264 key = _keys[i];
1265 if (predicate(obj[key], key, obj)) return key;
1266 }
1267}
1268
1269// Internal function to generate `_.findIndex` and `_.findLastIndex`.
1270function createPredicateIndexFinder(dir) {

Callers

nothing calls this directly

Calls 3

predicateFunction · 0.85
cbFunction · 0.70
keysFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…