Chore(medusa,utils,types,inventory,stock-location): remove core dependency modules (#3531)

This commit is contained in:
Carlos R. L. Rodrigues
2023-03-23 08:07:32 -03:00
committed by GitHub
parent bfef22b33e
commit 4e9d257d3b
159 changed files with 1769 additions and 693 deletions

View File

@@ -0,0 +1,16 @@
import { ulid } from "ulid"
/**
* Generate a composed id based on the input parameters and return either the is if it exists or the generated one.
* @param idProperty
* @param prefix
*/
export function generateEntityId(idProperty: string, prefix?: string): string {
if (idProperty) {
return idProperty
}
const id = ulid()
prefix = prefix ? `${prefix}_` : ""
return `${prefix}${id}`
}