MCPcopy Index your code
hub / github.com/QwikDev/qwik / addMember

Function addMember

scripts/api-docs.ts:90–153  ·  view source on GitHub ↗
(apiExtract: any, hierarchyStr: string)

Source from the content-addressed store, hash-verified

88 };
89
90 function addMember(apiExtract: any, hierarchyStr: string) {
91 const apiName = apiExtract.name || '';
92 const apiKind = apiExtract.kind || '';
93 if (apiName.length === 0) {
94 return;
95 }
96
97 if (apiKind === 'PropertySignature') {
98 if (!apiName.includes(':')) {
99 // do not include PropertySignatures unless they are namespaced
100 // like q:slot or preventdefault:click
101 return;
102 }
103 }
104
105 const hierarchySplit = hierarchyStr.split('/').filter((m) => m.length > 0);
106 hierarchySplit.push(apiName);
107
108 const hierarchy = hierarchySplit.map((h) => {
109 return {
110 name: h,
111 id: getCanonical(hierarchySplit),
112 };
113 });
114
115 const id = getCanonical(hierarchySplit);
116
117 const mdFile = getMdFile(subPkgName, hierarchySplit);
118 const mdPath = join(apiOuputDir, mdFile);
119
120 const content: string[] = [];
121
122 if (existsSync(mdPath)) {
123 const mdSrcLines = readFileSync(mdPath, 'utf-8').split(/\r?\n/);
124
125 for (const line of mdSrcLines) {
126 if (line.startsWith('## ')) {
127 continue;
128 }
129 if (line.startsWith('[Home]')) {
130 continue;
131 }
132 if (line.startsWith('<!-- ')) {
133 continue;
134 }
135 if (line.startsWith('**Signature:**')) {
136 continue;
137 }
138 content.push(line);
139 }
140 } else {
141 console.log('Unable to find md for', mdFile);
142 }
143
144 apiData.members.push({
145 name: apiName,
146 id,
147 hierarchy,

Callers 1

addMembersFunction · 0.85

Calls 5

getCanonicalFunction · 0.85
getMdFileFunction · 0.85
joinFunction · 0.85
getEditUrlFunction · 0.85
joinMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…