diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-22 02:06:53 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-22 02:06:53 +0800 |
commit | 8e2c0bb97758a978f704ad8aea916cbfe43abc16 (patch) | |
tree | d0a49d1e2daf720deea5bbb749a4184518038ee3 /packages/sol-cov/src/utils.ts | |
parent | c34897036e8cf896e6d0b3c7733ed9c739921f74 (diff) | |
parent | 88500e37146dc9152050fdd810f9f3c3cc5faf9f (diff) | |
download | dexon-sol-tools-8e2c0bb97758a978f704ad8aea916cbfe43abc16.tar dexon-sol-tools-8e2c0bb97758a978f704ad8aea916cbfe43abc16.tar.gz dexon-sol-tools-8e2c0bb97758a978f704ad8aea916cbfe43abc16.tar.bz2 dexon-sol-tools-8e2c0bb97758a978f704ad8aea916cbfe43abc16.tar.lz dexon-sol-tools-8e2c0bb97758a978f704ad8aea916cbfe43abc16.tar.xz dexon-sol-tools-8e2c0bb97758a978f704ad8aea916cbfe43abc16.tar.zst dexon-sol-tools-8e2c0bb97758a978f704ad8aea916cbfe43abc16.zip |
Merge branch 'v2-prototype' of https://github.com/0xProject/0x-monorepo into feature/website/mobile-friendly-onboarding
Diffstat (limited to 'packages/sol-cov/src/utils.ts')
-rw-r--r-- | packages/sol-cov/src/utils.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/sol-cov/src/utils.ts b/packages/sol-cov/src/utils.ts index 4f16a1cda..d31696636 100644 --- a/packages/sol-cov/src/utils.ts +++ b/packages/sol-cov/src/utils.ts @@ -66,4 +66,10 @@ export const utils = { } return structLogs; }, + getRange(sourceCode: string, range: SingleFileSourceRange): string { + const lines = sourceCode.split('\n').slice(range.start.line - 1, range.end.line); + lines[lines.length - 1] = lines[lines.length - 1].slice(0, range.end.column); + lines[0] = lines[0].slice(range.start.column); + return lines.join('\n'); + }, }; |