Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,13 @@ changes:
* `'strip'` Only strip type annotations without performing the transformation of TypeScript features.
* `sourceUrl` {string} Specifies the source url used in the source map.
* Returns: {string} The code with type annotations stripped.
`module.stripTypeScriptTypes()` removes type annotations from TypeScript code. It
can be used to strip type annotations from TypeScript code before running it
with `vm.runInContext()` or `vm.compileFunction()`.
By default, it will throw an error if the code contains TypeScript features
that require transformation such as `Enums`,
see [type-stripping][] for more information.

`module.stripTypeScriptTypes()` removes type annotations from TypeScript code. It
can be used to strip type annotations from TypeScript code before running it
with `vm.runInContext()` or `vm.compileFunction()`.

By default, it will throw an error if the code contains TypeScript features
that require transformation, such as `enum`s. See [type-stripping][] for more information.

_WARNING_: The output of this function should not be considered stable across Node.js versions,
due to changes in the TypeScript parser.
Expand Down
Loading