MCPcopy Create free account
hub / github.com/DIYgod/RSSHub / isTargetTypedDeclaration

Function isTargetTypedDeclaration

scripts/workflow/format-description.ts:143–158  ·  view source on GitHub ↗
(decl: typescript.VariableDeclaration)

Source from the content-addressed store, hash-verified

141const TARGETS: Record<string, string> = { route: 'Route', namespace: 'Namespace' };
142
143function isTargetTypedDeclaration(decl: typescript.VariableDeclaration): boolean {
144 if (!typescript.isIdentifier(decl.name)) {
145 return false;
146 }
147 const expectedType = TARGETS[decl.name.text];
148 if (!expectedType) {
149 return false;
150 }
151 if (decl.type && typescript.isTypeReferenceNode(decl.type)) {
152 const typeName = decl.type.typeName;
153 if (typescript.isIdentifier(typeName) && typeName.text === expectedType) {
154 return true;
155 }
156 }
157 return false;
158}
159
160function collectDescriptionEdits(sourceFile: typescript.SourceFile): DescriptionEdit[] {
161 const edits: DescriptionEdit[] = [];

Callers 1

collectDescriptionEditsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected