xiazcy commented on code in PR #3242:
URL: https://github.com/apache/tinkerpop/pull/3242#discussion_r2437374915


##########
gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js:
##########
@@ -311,10 +311,30 @@ class TraversalStrategySerializer extends TypeSerializer {
   }
 }
 
+/**
+ * Helper function to deserialize properties into arrays of VertexProperty or 
Property according to graphSONV3.
+ */
+function deserializeProperties(value, reader) {
+  let properties = [];
+  if ('properties' in value) {
+    const props = reader.read(value['properties']);
+    if (props !== null && props !== undefined) {
+      properties = Object.entries(props).flatMap(([key, values]) => {
+        if (Array.isArray(values) && values.length > 0 && values[0] instanceof 
g.VertexProperty) {
+          return values; // Flatten VertexProperty arrays
+        }
+        return values instanceof g.Property ? values : new g.Property(key, 
values); // create Property object when needed
+      });
+    }
+  }
+  return properties;
+}
+
 class VertexSerializer extends TypeSerializer {
   deserialize(obj) {
     const value = obj[valueKey];
-    return new g.Vertex(this.reader.read(value['id']), value['label'], 
this.reader.read(value['properties']));
+    console.log(value);

Review Comment:
   Oh yes, leftover. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to