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

Function read

javascript/packages/core/lib/gen/collection.ts:574–582  ·  view source on GitHub ↗
(accessor: (expr: string) => string, refState: string)

Source from the content-addressed store, hash-verified

572 }
573
574 read(accessor: (expr: string) => string, refState: string): string {
575 if (this.isAny()) {
576 return accessor(`new (${this.builder.getExternal(CollectionAnySerializer.name)})(${this.builder.getWriteContextName()}, ${this.builder.getReadContextName()}).read((result, i, v) => {
577 ${this.putAccessor("result", "v", "i")};
578 }, (len) => ${this.newCollection("len")}, ${refState});
579 `);
580 }
581 return this.readSpecificType(accessor, refState);
582 }
583}
584
585CodegenRegistry.registerExternal(CollectionSerializerGenerator);

Callers 1

readMethod · 0.70

Calls 7

isAnyMethod · 0.80
getWriteContextNameMethod · 0.80
getReadContextNameMethod · 0.80
readSpecificTypeMethod · 0.80
newCollectionMethod · 0.65
getExternalMethod · 0.45
putAccessorMethod · 0.45

Tested by

no test coverage detected