UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

13 lines (11 loc) 246 B
function findKey(map, doesMatch) { let result = undefined; for (const [key, value] of map) { if (doesMatch(value, key, map)) { result = key; break; } } return result; } export { findKey };