collection-abstraction/pairs

View on GitHub
src/insert.js

Summary

Maintainability
A
0 mins
Test Coverage
export default function insert(map, A, B) {
    if (map.has(A)) {
        map.get(A).add(B);
    } else {
        map.set(A, new Set([B]));
    }
}