aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/src/utils.ts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-05-16 03:52:49 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-05-16 03:52:49 +0800
commit9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a (patch)
treef72aae5170b6f1f6d3d70ebf6c03ed171680ff50 /packages/sol-cov/src/utils.ts
parent9744b1906a111aa0c65c8fafb4db66aef32a5a23 (diff)
parent6aed4fb1ae27dabed027c855f2cbdc0bfb4f3b6b (diff)
downloaddexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar
dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.gz
dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.bz2
dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.lz
dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.xz
dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.tar.zst
dexon-sol-tools-9e0471bfbb4bb2b3b490e10ce34b16c88e8bab9a.zip
Merge branch 'development' into v2-prototype
Diffstat (limited to 'packages/sol-cov/src/utils.ts')
-rw-r--r--packages/sol-cov/src/utils.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/sol-cov/src/utils.ts b/packages/sol-cov/src/utils.ts
index f155043a1..d970c42ee 100644
--- a/packages/sol-cov/src/utils.ts
+++ b/packages/sol-cov/src/utils.ts
@@ -4,6 +4,10 @@ export const utils = {
compareLineColumn(lhs: LineColumn, rhs: LineColumn): number {
return lhs.line !== rhs.line ? lhs.line - rhs.line : lhs.column - rhs.column;
},
+ removeHexPrefix(hex: string): string {
+ const hexPrefix = '0x';
+ return hex.startsWith(hexPrefix) ? hex.slice(hexPrefix.length) : hex;
+ },
isRangeInside(childRange: SingleFileSourceRange, parentRange: SingleFileSourceRange): boolean {
return (
utils.compareLineColumn(parentRange.start, childRange.start) <= 0 &&