UNPKG

es-toolkit

Version:

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

12 lines (10 loc) 235 B
function filter(map, callback) { const result = new Map(); for (const [key, value] of map) { if (callback(value, key, map)) { result.set(key, value); } } return result; } export { filter };