in src/objectEnumerationBuilder.ts [130:155]
public static merge(x: VisualObjectInstanceEnumeration, y: VisualObjectInstanceEnumeration): VisualObjectInstanceEnumerationObject {
let xNormalized = ObjectEnumerationBuilder.normalize(x);
let yNormalized = ObjectEnumerationBuilder.normalize(y);
if (!xNormalized || !yNormalized)
return xNormalized || yNormalized;
let xCategoryCount = xNormalized.containers ? xNormalized.containers.length : 0;
for (let yInstance of yNormalized.instances) {
xNormalized.instances.push(yInstance);
if (yInstance.containerIdx != null)
yInstance.containerIdx += xCategoryCount;
}
let yContainers = yNormalized.containers;
if (!_.isEmpty(yContainers)) {
if (xNormalized.containers)
Array.prototype.push.apply(xNormalized.containers, yContainers);
else
xNormalized.containers = yContainers;
}
return xNormalized;
}