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

Function detectAnySerializer

javascript/packages/core/test/schema-limit.test.js:128–136  ·  view source on GitHub ↗
(readContext, typeMeta)

Source from the content-addressed store, hash-verified

126}
127
128function detectAnySerializer(readContext, typeMeta) {
129 const encoded = typeMeta.toBytes();
130 const bytes = new Uint8Array(encoded.length + 2);
131 bytes[0] = TypeId.COMPATIBLE_STRUCT;
132 bytes[1] = 0;
133 bytes.set(encoded, 2);
134 readContext.reset(bytes);
135 return AnyHelper.detectSerializer(readContext);
136}
137
138function localSerializer(typeInfo) {
139 const typeMeta = TypeMeta.fromTypeInfo(typeInfo);

Callers 1

Calls 4

detectSerializerMethod · 0.80
resetMethod · 0.65
toBytesMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected