@parcel/source-map
Advanced tools
Comparing version 2.0.0-alpha.4.15 to 2.0.0-alpha.4.16
@@ -289,2 +289,41 @@ "use strict"; | ||
/** | ||
* Offset mapping lines from a certain position | ||
* | ||
* @param line the line in the generated code (starts at 1) | ||
* @param lineOffset the amount of lines to offset mappings by | ||
*/ | ||
offsetLines(line, lineOffset) { | ||
if (line < 1 || line + lineOffset < 1) { | ||
throw new Error('Line has to be positive'); | ||
} | ||
if (lineOffset === 0) { | ||
return; | ||
} | ||
this.sourceMapInstance.offsetLines(line - 1, lineOffset); | ||
} | ||
/** | ||
* Offset mapping columns from a certain position | ||
* | ||
* @param line the line in the generated code (starts at 1) | ||
* @param column the column in the generated code (starts at 0) | ||
* @param columnOffset the amount of columns to offset mappings by | ||
*/ | ||
offsetColumns(line, column, columnOffset) { | ||
if (line < 1 || column < 0 || column + columnOffset < 0) { | ||
throw new Error('Line and Column has to be positive'); | ||
} | ||
if (columnOffset === 0) { | ||
return; | ||
} | ||
this.sourceMapInstance.offsetColumns(line - 1, column, columnOffset); | ||
} | ||
/** | ||
* Returns a flatbuffer that represents this sourcemap, used for caching | ||
@@ -291,0 +330,0 @@ */ |
{ | ||
"name": "@parcel/source-map", | ||
"version": "2.0.0-alpha.4.15", | ||
"version": "2.0.0-alpha.4.16", | ||
"main": "./dist/node.js", | ||
@@ -5,0 +5,0 @@ "browser": "./dist/wasm-browser.js", |
@@ -281,2 +281,39 @@ // @flow | ||
/** | ||
* Offset mapping lines from a certain position | ||
* | ||
* @param line the line in the generated code (starts at 1) | ||
* @param lineOffset the amount of lines to offset mappings by | ||
*/ | ||
offsetLines(line: number, lineOffset: number): ?IndexedMapping<string> { | ||
if (line < 1 || line + lineOffset < 1) { | ||
throw new Error('Line has to be positive'); | ||
} | ||
if (lineOffset === 0) { | ||
return; | ||
} | ||
this.sourceMapInstance.offsetLines(line - 1, lineOffset); | ||
} | ||
/** | ||
* Offset mapping columns from a certain position | ||
* | ||
* @param line the line in the generated code (starts at 1) | ||
* @param column the column in the generated code (starts at 0) | ||
* @param columnOffset the amount of columns to offset mappings by | ||
*/ | ||
offsetColumns(line: number, column: number, columnOffset: number): ?IndexedMapping<string> { | ||
if (line < 1 || column < 0 || column + columnOffset < 0) { | ||
throw new Error('Line and Column has to be positive'); | ||
} | ||
if (columnOffset === 0) { | ||
return; | ||
} | ||
this.sourceMapInstance.offsetColumns(line - 1, column, columnOffset); | ||
} | ||
/** | ||
* Returns a flatbuffer that represents this sourcemap, used for caching | ||
@@ -283,0 +320,0 @@ */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1560356
1691