UNPKG

203 BPlain TextView Raw
1const map = {};
2
3export default (prefix?: string): string => {
4 prefix = prefix || 'g';
5 if (!map[prefix]) {
6 map[prefix] = 1;
7 } else {
8 map[prefix] += 1;
9 }
10 return prefix + map[prefix];
11};