Last active
November 29, 2023 14:32
-
-
Save enriquebeta6/385e57c881e9240cd2a4d6353790c561 to your computer and use it in GitHub Desktop.
This function returns the dynamic entity and schema created by the https://github.com/vtex/io-clients/blob/3391975288a7cd73b353bafe1d74e2d37a2e09c2/src/clients/masterData/MasterDataEntity/MasterDataEntityV1.ts#L32 (master data factory client)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getEntityNameAndSchemaOfMDV2({ | |
appName, | |
vendor, | |
entity, | |
version, | |
workspace = '', | |
}) { | |
return { | |
entityName: `${vendor}_${appName}_${entity}`.replace(/(\.)|-|:|@/gi, "_"), | |
schema: [version, workspace].filter(Boolean).join('-'), | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment