• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

streetsidesoftware / cspell / 20444762998

22 Dec 2025 09:43PM UTC coverage: 92.761% (-0.5%) from 93.247%
20444762998

Pull #8204

github

web-flow
Merge 93ac39324 into c81097e48
Pull Request #8204: feat: Add Support reading / writing bTrie files

8469 of 10950 branches covered (77.34%)

231 of 274 new or added lines in 15 files covered. (84.31%)

2 existing lines in 1 file now uncovered.

16491 of 17778 relevant lines covered (92.76%)

30777.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/packages/cspell-tools/src/compiler/readers/readTextFile.ts
1
import assert from 'node:assert';
2
import { Buffer } from 'node:buffer';
3
import { promises as fs } from 'node:fs';
4

5
import { decompress } from '../../gzip/index.js';
6

7
const isGzFile = /\.gz$/;
12✔
8

9
export function readTextFile(filename: string): Promise<string> {
10
    const content = fs
119✔
11
        .readFile(filename)
12
        .then(async (buffer) => (isGzFile.test(filename) ? decompress(buffer) : buffer))
119✔
13
        .then((buffer) => (assertIsBuffer(buffer), buffer.toString('utf8')));
119✔
14
    return content;
119✔
15
}
16

17
export async function readTextFileLines(filename: string): Promise<string[]> {
UNCOV
18
    const content = await readTextFile(filename);
×
UNCOV
19
    return content.split('\n');
×
20
}
21

22
function assertIsBuffer(value: unknown): asserts value is Buffer {
23
    assert(Buffer.isBuffer(value));
119✔
24
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc