MCPcopy Create free account
hub / github.com/tinyplex/tinybase / removeSvelteInternalParam

Function removeSvelteInternalParam

site/build.ts:145–182  ·  view source on GitHub ↗
(reflection)

Source from the content-addressed store, hash-verified

143};
144
145const removeSvelteInternalParam: ReflectionTransform = (reflection) => {
146 if (!SVELTE_REFLECTION.test(reflection.getFriendlyFullName())) {
147 return;
148 }
149 const comment = (reflection as {comment?: ReflectionComment}).comment;
150 if (comment != null) {
151 comment.blockTags = comment.blockTags.filter(
152 ({tag, name}) =>
153 tag != '@param' || !SVELTE_INTERNAL_PARAM.test(name ?? ''),
154 );
155 }
156 const signature = reflection as {parameters?: {name: string}[]};
157 if (signature.parameters != null) {
158 signature.parameters = signature.parameters.filter(
159 ({name}) => !SVELTE_INTERNAL_PARAM.test(name),
160 );
161 }
162 const container = reflection as ReflectionContainer;
163 if (container.groups != null) {
164 container.groups = container.groups
165 .map((group) =>
166 group.title != 'Properties'
167 ? group
168 : {
169 ...group,
170 children: group.children.filter(
171 ({name}) => !SVELTE_PRIVATE_MEMBER.test(name),
172 ),
173 },
174 )
175 .filter((group) => group.children.length > 0);
176 }
177 if (container.children != null) {
178 container.children = container.children.filter(
179 ({name}) => !SVELTE_PRIVATE_MEMBER.test(name),
180 );
181 }
182};
183
184const hidePrivateSvelteComponentChildren: NodeTransform = (node) => {
185 if (SVELTE_PRIVATE_PROPERTY.test(node.url)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…