Fast, zero-configuration Flow type annotation removal tool for JavaScript with CLI and programmatic APIs
84
A simple utility that removes Flow interface declarations and type aliases from JavaScript source code.
Build a Node.js module that removes Flow type definitions from JavaScript source strings. The tool should:
interface User { name: string })type ID = string | number)The output should be valid JavaScript that can run in any JavaScript environment, with type definitions removed but functional code intact.
interface Person { name: string; } followed by a function, the module removes only the interface @testtype Status = "active" | "inactive";, the module removes the type alias @testtype Handler = (data: string) => void;, the module removes it @test@generates
/**
* Removes Flow type definitions (interfaces and type aliases) from JavaScript source code
*
* @param {string} sourceCode - JavaScript source code containing Flow type annotations
* @returns {string} Cleaned JavaScript code with type definitions removed
*/
function stripFlowTypes(sourceCode) {
// Implementation
}
module.exports = { stripFlowTypes };Provides Flow type annotation removal functionality.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-flow-remove-typesevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10