Include T deserializer
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bf43cdc5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bf43cdc5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bf43cdc5 Branch: refs/heads/TINKERPOP-1489 Commit: bf43cdc5798a6a7bf6e00e3932b76c3d4b1f47a6 Parents: 343ddc2 Author: Jorge Bay Gondra <jorgebaygon...@gmail.com> Authored: Wed Jan 17 16:52:05 2018 +0100 Committer: Jorge Bay Gondra <jorgebaygon...@gmail.com> Committed: Wed Jan 17 16:52:05 2018 +0100 ---------------------------------------------------------------------- gremlin-javascript/glv/TraversalSource.template | 4 ++++ .../javascript/gremlin-javascript/lib/process/traversal.js | 4 ++++ .../gremlin-javascript/lib/structure/io/graph-serializer.js | 3 ++- .../gremlin-javascript/lib/structure/io/type-serializers.js | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bf43cdc5/gremlin-javascript/glv/TraversalSource.template ---------------------------------------------------------------------- diff --git a/gremlin-javascript/glv/TraversalSource.template b/gremlin-javascript/glv/TraversalSource.template index d707a42..3f289e4 100644 --- a/gremlin-javascript/glv/TraversalSource.template +++ b/gremlin-javascript/glv/TraversalSource.template @@ -182,6 +182,10 @@ class EnumValue { this.typeName = typeName; this.elementName = elementName; } + + toString() { + return this.elementName; + } } module.exports = { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bf43cdc5/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js ---------------------------------------------------------------------- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js index 2877f02..a8d066a 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/traversal.js @@ -242,6 +242,10 @@ class EnumValue { this.typeName = typeName; this.elementName = elementName; } + + toString() { + return this.elementName; + } } module.exports = { http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bf43cdc5/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js ---------------------------------------------------------------------- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js index 3dbd340..df05659 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/graph-serializer.js @@ -159,7 +159,8 @@ const deserializers = { 'g:Edge': typeSerializers.EdgeSerializer, 'g:VertexProperty': typeSerializers.VertexPropertySerializer, 'g:Property': typeSerializers.PropertySerializer, - 'g:Path': typeSerializers.PathSerializer + 'g:Path': typeSerializers.PathSerializer, + 'g:T': typeSerializers.TSerializer }; const serializers = [ http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bf43cdc5/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js ---------------------------------------------------------------------- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js index d6f131c..304888f 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/structure/io/type-serializers.js @@ -270,6 +270,12 @@ class PathSerializer extends TypeSerializer { } } +class TSerializer extends TypeSerializer { + deserialize(obj) { + return t.t[obj[valueKey]]; + } +} + module.exports = { BytecodeSerializer, EdgeSerializer, @@ -280,6 +286,7 @@ module.exports = { PathSerializer, PropertySerializer, PSerializer, + TSerializer, TraverserSerializer, typeKey, valueKey,