@@ -394,16 +394,20 @@ added: v22.13.0
394394 will be generated for the transformed code.
395395 * ` sourceUrl` {string} Specifies the source url used in the source map.
396396* Returns: {string} The code with type annotations stripped.
397- ` module .stripTypeScriptTypes ()` removes type annotations from TypeScript code. It
398- can be used to strip type annotations from TypeScript code before running it
399- with ` vm.runInContext()` or ` vm.compileFunction()` .
400- By default, it will throw an error if the code contains TypeScript features
401- that require transformation such as ` Enums` ,
402- see [type-stripping][] for more information.
403- When mode is ` ' transform' ` , it also transforms TypeScript features to JavaScript,
404- see [transform TypeScript features][] for more information.
405- When mode is ` ' strip' ` , source maps are not generated, because locations are preserved.
406- If ` sourceMap` is provided, when mode is ` ' strip' ` , an error will be thrown.
397+
398+ ` module .stripTypeScriptTypes ()` removes type annotations from TypeScript code. It
399+ can be used to strip type annotations from TypeScript code before running it
400+ with ` vm.runInContext()` or ` vm.compileFunction()` .
401+
402+ By default, it will throw an error if the code contains TypeScript features
403+ that require transformation such as ` Enums` ,
404+ see [type-stripping][] for more information.
405+
406+ When mode is ` ' transform' ` , it also transforms TypeScript features to JavaScript,
407+ see [transform TypeScript features][] for more information.
408+
409+ When mode is ` ' strip' ` , source maps are not generated, because locations are preserved.
410+ If ` sourceMap` is provided, when mode is ` ' strip' ` , an error will be thrown.
407411
408412_WARNING_: The output of this function should not be considered stable across Node.js versions,
409413due to changes in the TypeScript parser.
0 commit comments