MCPcopy Create free account
hub / github.com/apache/fory / writeEmbed

Method writeEmbed

javascript/packages/core/lib/gen/ext.ts:141–155  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

139 }
140
141 writeEmbed() {
142 return new Proxy({}, {
143 get: (target, prop: string) => {
144 return (accessor: string) => {
145 const name = this.scope.declare(
146 "ext_ser",
147 TypeId.isNamedType(this.typeInfo.typeId)
148 ? this.builder.typeResolver.getSerializerByName(CodecBuilder.replaceBackslashAndQuote(this.typeInfo.named!))
149 : this.builder.typeResolver.getSerializerById(this.typeInfo.typeId, this.typeInfo.userTypeId)
150 );
151 return `${name}.${prop}(${accessor})`;
152 };
153 },
154 });
155 }
156
157 writeTypeInfo(): string {
158 const internalTypeId = this.getInternalTypeId();

Callers

nothing calls this directly

Calls 5

declareMethod · 0.80
isNamedTypeMethod · 0.45
getSerializerByNameMethod · 0.45
getSerializerByIdMethod · 0.45

Tested by

no test coverage detected