mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 01:53:33 -06:00
9 lines
186 B
TypeScript
9 lines
186 B
TypeScript
export function mapSet<T, R>(set: Set<T>, callback: (t: T) => R): Set<R> {
|
|
const newSet = new Set<R>();
|
|
for (const el of set) {
|
|
newSet.add(callback(el));
|
|
}
|
|
|
|
return newSet;
|
|
}
|