| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7508540 commit e6b131f
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -257,16 +257,20 @@ added: | |||
| 257 | 257 | will be generated for the transformed code. | |
| 258 | 258 | * `sourceUrl` {string} Specifies the source url used in the source map. | |
| 259 | 259 | * 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. | ||
| 270 | 274 | ||
| 271 | 275 | _WARNING_: The output of this function should not be considered stable across Node.js versions, | |
| 272 | 276 | due to changes in the TypeScript parser. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments