MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / parseStruct

Function parseStruct

src/parser/parser.ts:61–71  ·  view source on GitHub ↗
(scopeName: string, subNode: StructDefinition)

Source from the content-addressed store, hash-verified

59}
60
61export function parseStruct(scopeName: string, subNode: StructDefinition): StructType {
62 const {type, name, members, coderType} = subNode;
63 const namePath = `${scopeName}.${name}`;
64 const fields = members.map(member => parseMember(scopeName, member, coderType));
65 const accessors = subNode.accessors && {
66 getterCoderType: subNode.accessors.getterCoderType,
67 setterCoderType: subNode.accessors.setterCoderType,
68 };
69 const groups = (subNode.groups ?? []).map(parseGroup)
70 return { name, type, namePath, fields, coderType: coderType || 'checked', accessors, groups };
71}
72
73export function parseGroup(subnode: GroupDefinition): GroupType {
74 const { name, accessors, coderType } = subnode;

Callers

nothing calls this directly

Calls 1

parseMemberFunction · 0.85

Tested by

no test coverage detected