Skip to content

Commit e6b131f

Browse files
Renegade334richardlau
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 7508540 commit e6b131f

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

doc/api/module.md

Lines changed: 14 additions & 10 deletions
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)