You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/compiler/generate/utils/counter.js

13 lines
206 B

export default function counter () {
const counts = {};
return function ( label ) {
if ( label in counts ) {
return `${label}${counts[ label ]++}`;
}
counts[ label ] = 1;
return label;
};
}