chore: Cleanup medusa test utils (#7464)
* chore: Cleanup medusa test utils * update yarn * cleanup * fix key * cleanup * fixes * fixes * fixes * fixes * fix runners * fix bootstrap * naming * Improve runners options * Improve runners options * Improve runners options * cleanup * fix tests
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import randomize from "randomatic"
|
||||
|
||||
class IdMap {
|
||||
ids = {}
|
||||
|
||||
getId(key, prefix = "", length = 10) {
|
||||
if (this.ids[key]) {
|
||||
return this.ids[key]
|
||||
}
|
||||
|
||||
const id = `${prefix && prefix + "_"}${randomize("Aa0", length)}`
|
||||
this.ids[key] = id
|
||||
|
||||
return id
|
||||
}
|
||||
}
|
||||
|
||||
const instance = new IdMap()
|
||||
export default instance
|
||||
Reference in New Issue
Block a user