export const buildCatalogObjectList = (catalogObjects, children, catalogObjectList) => {
    if (children.length > 0) {
        for (const child of children) {
            const matchingChildCatalogObject = catalogObjectList.find((co) => co.catalogObjectName === child.reference);
            if (matchingChildCatalogObject) {
                const existingCatalogObject = catalogObjects.find((co) => co.catalogObjectName ===
                    matchingChildCatalogObject.catalogObjectName);
                if (!existingCatalogObject) {
                    catalogObjects.push(matchingChildCatalogObject);
                    const childsChildren = matchingChildCatalogObject.properties.filter((property) => {
                        var _a;
                        return ((_a = property.extendedProperties) === null || _a === void 0 ? void 0 : _a.childEntity) === true;
                    });
                    buildCatalogObjectList(catalogObjects, childsChildren, catalogObjectList);
                }
            }
        }
    }
};
//# sourceMappingURL=CatalogUtilities.js.map