adamrenklint/bap

View on GitHub
lib/utils/uniqueId.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
var counts = {};

function uniqueId (prefix) {
  counts[prefix] = counts[prefix] || 0;
  return prefix + '-' + (++counts[prefix]);
}

module.exports = uniqueId;