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) 225 B
function filter(set, callback) { const result = new Set(); for (const value of set) { if (callback(value, value, set)) { result.add(value); } } return result; } export { filter };