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

Function remoteStruct

javascript/packages/core/test/schema-limit.test.js:56–76  ·  view source on GitHub ↗
(
  name,
  fieldName,
  fieldType = Type.int32({ encoding: "fixed" }),
  typeId = TypeId.NAMED_STRUCT,
  userTypeId = -1,
)

Source from the content-addressed store, hash-verified

54}
55
56function remoteStruct(
57 name,
58 fieldName,
59 fieldType = Type.int32({ encoding: "fixed" }),
60 typeId = TypeId.NAMED_STRUCT,
61 userTypeId = -1,
62) {
63 return new TypeMeta([new FieldInfo(
64 fieldName,
65 fieldType.typeId,
66 fieldType.userTypeId,
67 fieldType.trackingRef === true,
68 fieldType.nullable === true,
69 fieldType.options,
70 )], {
71 namespace: "example",
72 typeId,
73 typeName: name,
74 userTypeId,
75 });
76}
77
78function anyStruct(fieldName, fieldType = Type.int32({ encoding: "fixed" })) {
79 return remoteStruct("", fieldName, fieldType, TypeId.COMPATIBLE_STRUCT, 901);

Callers 2

anyStructFunction · 0.85

Calls 1

int32Method · 0.80

Tested by

no test coverage detected