diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-05-09 02:04:31 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-05-09 02:04:31 +0800 |
commit | 607d738342a839788b59e0dee63849ea447331bc (patch) | |
tree | d90078ec0e95357a2fe9fb4af65f9135e9e44408 /packages/sol-cov/src/utils.ts | |
parent | b8c611de2b82657a274c55007ffc5d72807eae7f (diff) | |
parent | e9d70b7b1edb5089a6e5e2a9ee8c964ab4b4d4ab (diff) | |
download | dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.gz dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.bz2 dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.lz dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.xz dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.tar.zst dexon-sol-tools-607d738342a839788b59e0dee63849ea447331bc.zip |
Merge branch 'development' into feature/website/top-bar-redesign
* development: (63 commits)
Update The Ocean logo
Fix artifacts paths
Create an artifacts folder
Introduce a var
Add removeHexPrefix util method
CHeck if ABI exists
Improve the readability of the check for should compile
Use named constants
Add a comment
Fix comments
Rename args to constructor-args
Fix a typo
Define a separator const
Move artifacts from src/artifacts to artifacts/v1
Fix sol-cov to work with the new artifacts format
Implement new artifacts format
Publish
Updated CHANGELOGS
Make node types a dependency
Fix type errors in CSS properties
...
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 && |