venue-js 1.4.0-next.20 → 1.4.0-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1100,13 +1100,13 @@ var createUnitOpenings = (relationships, units, openings) => {
1100
1100
  });
1101
1101
  units.forEach((unit) => {
1102
1102
  const unitId = unit.id;
1103
- const connectedRelationshop = relationshipMap.get(unitId) || [];
1104
- const relationshipIntermediaryTypeAndId = connectedRelationshop.map(
1105
- (relationship) => relationship.properties.intermediary[0]
1103
+ const connectedRelationship = relationshipMap.get(unitId) || [];
1104
+ const relationshipIntermediaryTypeAndId = compact(connectedRelationship.map(
1105
+ (relationship) => relationship.properties.intermediary?.[0]
1106
1106
  // Assuming intermediary is always an array
1107
- );
1107
+ ));
1108
1108
  const relationshipIntermediary = relationshipIntermediaryTypeAndId.map(({ id }) => {
1109
- return openings.find((opening) => opening.id === id);
1109
+ return openings.find((opening) => !!opening && opening.id === id);
1110
1110
  });
1111
1111
  openingConnections[unitId] = uniqBy(
1112
1112
  [...openingConnections[unitId] || [], ...relationshipIntermediary],
@@ -1131,8 +1131,7 @@ var prepareGraph = (options) => {
1131
1131
  relationships = [],
1132
1132
  openings = [],
1133
1133
  units = [],
1134
- kiosks = [],
1135
- levels = []
1134
+ kiosks = []
1136
1135
  }
1137
1136
  } = options;
1138
1137
  const {