UNPKG

es-toolkit

Version:

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

11 lines (9 loc) 225 B
function map(set, getNewValue) { const result = new Set(); for (const value of set) { const newValue = getNewValue(value, value, set); result.add(newValue); } return result; } export { map };