Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8511b1c

Browse filesBrowse files
Renegade334aduh95
authored andcommitted
doc: fix module.stripTypeScriptTypes indentation
PR-URL: #61992 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent dd1139f commit 8511b1c
Copy full SHA for 8511b1c

1 file changed

+14-10Lines changed: 14 additions & 10 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/module.md‎

Copy file name to clipboardExpand all lines: doc/api/module.md
+14-10Lines changed: 14 additions & 10 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -257,16 +257,20 @@ added:
257257
will be generated for the transformed code.
258258
* `sourceUrl` {string} Specifies the source url used in the source map.
259259
* Returns: {string} The code with type annotations stripped.
260-
`module.stripTypeScriptTypes()` removes type annotations from TypeScript code. It
261-
can be used to strip type annotations from TypeScript code before running it
262-
with `vm.runInContext()` or `vm.compileFunction()`.
263-
By default, it will throw an error if the code contains TypeScript features
264-
that require transformation such as `Enums`,
265-
see [type-stripping][] for more information.
266-
When mode is `'transform'`, it also transforms TypeScript features to JavaScript,
267-
see [transform TypeScript features][] for more information.
268-
When mode is `'strip'`, source maps are not generated, because locations are preserved.
269-
If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown.
260+
261+
`module.stripTypeScriptTypes()` removes type annotations from TypeScript code. It
262+
can be used to strip type annotations from TypeScript code before running it
263+
with `vm.runInContext()` or `vm.compileFunction()`.
264+
265+
By default, it will throw an error if the code contains TypeScript features
266+
that require transformation such as `Enums`,
267+
see [type-stripping][] for more information.
268+
269+
When mode is `'transform'`, it also transforms TypeScript features to JavaScript,
270+
see [transform TypeScript features][] for more information.
271+
272+
When mode is `'strip'`, source maps are not generated, because locations are preserved.
273+
If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown.
270274
271275
_WARNING_: The output of this function should not be considered stable across Node.js versions,
272276
due to changes in the TypeScript parser.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.