(jsCodeString: string)
| 69 | } |
| 70 | |
| 71 | function 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 | } |
no outgoing calls
no test coverage detected