From 00e45978204a01ccaeba4ea938d4b32b5c1f1e0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9?= Date: Wed, 25 Feb 2026 21:29:41 +0000 Subject: [PATCH] doc: fix module.stripTypeScriptTypes indentation --- doc/api/module.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/doc/api/module.md b/doc/api/module.md index 81e49882def0bf..766cb5d0608f51 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -258,16 +258,19 @@ added: will be generated for the transformed code. * `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. - When mode is `'transform'`, it also transforms TypeScript features to JavaScript, - see [transform TypeScript features][] for more information. - When mode is `'strip'`, source maps are not generated, because locations are preserved. - If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown. + +`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. + +When mode is `'transform'`, it also transforms TypeScript features to JavaScript. +See [transform TypeScript features][] for more information. + +When mode is `'strip'`, source maps are not generated, because locations are preserved. +If `sourceMap` is provided, when mode is `'strip'`, an error will be thrown. _WARNING_: The output of this function should not be considered stable across Node.js versions, due to changes in the TypeScript parser.