Skip to content

Commit 1855829

Browse files
Renegade334marco-ippolito
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 8e20976 commit 1855829

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

doc/api/module.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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,
409413
due to changes in the TypeScript parser.

0 commit comments

Comments
 (0)