MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / stripBasicTypescriptTypes

Function stripBasicTypescriptTypes

lib/parsers/dataAnalysis.ts:71–82  ·  view source on GitHub ↗
(jsCodeString: string)

Source from the content-addressed store, hash-verified

69}
70
71function stripBasicTypescriptTypes(jsCodeString: string): string {
72 // Remove type definitions like `: string`, `: number`, `: any` etc.
73 jsCodeString = jsCodeString.replace(/:\s*\w*(?=\s*=\s*)/g, "");
74
75 // Remove interface definitions
76 jsCodeString = jsCodeString.replace(
77 /(export )?interface\s+\w+\s*\{[^}]+\}/g,
78 "",
79 );
80
81 return jsCodeString;
82}

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected