diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-07 20:46:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-07 20:46:28 +0800 |
commit | a9c5488620148c7ddc576bf99e02c25397230906 (patch) | |
tree | 3d86a42696ffb26c361d46dd54b6c3bce296ed09 /packages/sol-cov/src/utils.ts | |
parent | 69a6166b6a1d39afc24b8dd950ec5d8539a03420 (diff) | |
parent | 906af858a5b013927e06ebafdad12d13ba674932 (diff) | |
download | dexon-sol-tools-a9c5488620148c7ddc576bf99e02c25397230906.tar dexon-sol-tools-a9c5488620148c7ddc576bf99e02c25397230906.tar.gz dexon-sol-tools-a9c5488620148c7ddc576bf99e02c25397230906.tar.bz2 dexon-sol-tools-a9c5488620148c7ddc576bf99e02c25397230906.tar.lz dexon-sol-tools-a9c5488620148c7ddc576bf99e02c25397230906.tar.xz dexon-sol-tools-a9c5488620148c7ddc576bf99e02c25397230906.tar.zst dexon-sol-tools-a9c5488620148c7ddc576bf99e02c25397230906.zip |
Merge pull request #537 from 0xProject/feature/artifacts-v2
Implement the new artifacts format
Diffstat (limited to 'packages/sol-cov/src/utils.ts')
-rw-r--r-- | packages/sol-cov/src/utils.ts | 4 |
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 && |