Skip to content

Commit

Permalink
#54: Update convertAndSaveMetadata function
Browse files Browse the repository at this point in the history
  • Loading branch information
darnjo committed Sep 26, 2023
1 parent 9b8c715 commit 843e36c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/metadata/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ const convertMetadata = async xmlMetadata => {
const processedMetadata = schemas.reduce(
(
acc,
{ EntityType: entityTypes = [], /* EnumType: enumTypes = [], EntityContainer: entityContainer = {}, Namespace: namespace = null */ }
{ EntityType: entityTypes = [] /* EnumType: enumTypes = [], EntityContainer: entityContainer = {}, Namespace: namespace = null */ }
) => {
if (entityTypes?.length) {
acc.fields.push(
...entityTypes.map(
({ Key: primaryKey, Property: fields = [], BaseType: baseType, /* NavigationProperty: expansions = [], */ Name: resourceName }) => {
({
Key: primaryKey,
Property: fields = [],
BaseType: baseType,
/* NavigationProperty: expansions = [], */ Name: resourceName
}) => {
if (!resourceMap?.[resourceName]) {
resourceMap[resourceName] = {
resourceName,
Expand Down Expand Up @@ -143,7 +148,7 @@ const loadMetadataFile = async (pathToXmlMetadata = '') => {
}
};

const convertAndSaveMetadata = async (pathToXmlMetadata = '') => {
const convertAndSaveMetadata = async ({ pathToXmlMetadata = '' }) => {
try {
const xmlMetadata = await loadMetadataFile(pathToXmlMetadata);
const metadataReportJson = await convertMetadata(xmlMetadata);
Expand Down

0 comments on commit 843e36c

Please sign in to comment.