feat(pricing, types, utils, medusa-sdk): Pricing Module Setup + Currency (#4860)
What: - Setups the skeleton for pricing module - Creates service/model/repository for currency model - Setups types - Setups DB - Moved some utils to a common place RESOLVES CORE-1477 RESOLVES CORE-1476
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import randomize from "randomatic";
|
||||
import randomize from "randomatic"
|
||||
|
||||
class IdMap {
|
||||
ids = {};
|
||||
ids = {}
|
||||
|
||||
getId(key, prefix = "", length = 10) {
|
||||
if (this.ids[key]) {
|
||||
return this.ids[key];
|
||||
return this.ids[key]
|
||||
}
|
||||
|
||||
const id = `${prefix && prefix + "_"}${randomize("Aa0", length)}`;
|
||||
this.ids[key] = id;
|
||||
const id = `${prefix && prefix + "_"}${randomize("Aa0", length)}`
|
||||
this.ids[key] = id
|
||||
|
||||
return id;
|
||||
return id
|
||||
}
|
||||
}
|
||||
|
||||
const instance = new IdMap();
|
||||
export default instance;
|
||||
const instance = new IdMap()
|
||||
export default instance
|
||||
|
||||
Reference in New Issue
Block a user