1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-26 16:09:27 -05:00

docs(cli/dts): fix Deno.applySourceMap example (#10602)

This commit is contained in:
Casper Beyer 2021-05-12 21:14:48 +08:00 committed by GitHub
parent 1cd1419e18
commit 7211c7cf8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -526,18 +526,19 @@ declare namespace Deno {
* uncaught error is logged. This function can be used to perform the lookup
* for creating better error handling.
*
* **Note:** `line` and `column` are 1 indexed, which matches display
* **Note:** `lineNumber` and `columnNumber` are 1 indexed, which matches display
* expectations, but is not typical of most index numbers in Deno.
*
* An example:
*
* ```ts
* const orig = Deno.applySourceMap({
* const origin = Deno.applySourceMap({
* fileName: "file://my/module.ts",
* lineNumber: 5,
* columnNumber: 15
* });
* console.log(`${orig.filename}:${orig.line}:${orig.column}`);
*
* console.log(`${origin.fileName}:${origin.lineNumber}:${origin.columnNumber}`);
* ```
*/
export function applySourceMap(location: Location): Location;