houdini/javascripts/src/components/common/test/unique_id_mock.ts

16 lines
344 B
TypeScript
Raw Normal View History

2018-08-20 11:32:27 -05:00
// Under Lodash license (MIT/ISC) - https://raw.githubusercontent.com/lodash/lodash/4.17.10-npm/LICENSE
import * as _ from 'lodash'
export class UniqueIdMock {
idCounter:number=0
public uniqueId(prefix:string):string {
var id = ++this.idCounter;
return _.toString(prefix) + id;
}
public reset(){
this.idCounter = 0
}
}