UNPKG

chimp

Version:

Your development companion for doing quality, faster.

14 lines (13 loc) 420 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function default_1(names, exceptionHandler) { var _a; const nameCounts = new Map(); for (const name of names) { const val = ((_a = nameCounts.get(name)) !== null && _a !== void 0 ? _a : 0) + 1; if (val > 1) exceptionHandler(name); nameCounts.set(name, val); } } exports.default = default_1;