typestripped
typestripped(
code,options?):string
Defined in: .work/repos/typestripped/src/typestripped.ts:43
Transpiles TypeScript to JavaScript.
Don’t trust your production code with this. It takes some shortcuts, and I haven’t looked at any standards documents to write this. It’s intended as a lightweight means for transpiling live example code in the browser and for other quick demo’s and experiments.
Parameters
Section titled “Parameters”string
The input TypeScript.
options?
Section titled “options?”Options = {}
An optional object containing the following optional properties:
debugWhentrue, each consumed token is logged to stdout. If it’s a function, the same is logged to the function.recoverWhentrue, the function will attempt to continue transpilation when it encounters an error in the input (or unsupported syntax), instead of throwing. Errors are logged toconsole.error.transformImportAn async function that gets animportURI, and returns the URI to be include included in the transpiled output.
Returns
Section titled “Returns”string
The output JavaScript, if all went well.
Throws
Section titled “Throws”ParserError, if something went wrong.