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

streetsidesoftware / cspell / 20225088851

15 Dec 2025 08:16AM UTC coverage: 93.886%. First build
20225088851

Pull #8160

github

web-flow
Merge 5cb943a00 into 82c32f65f
Pull Request #8160: fix: Improve CSpell Tools

8359 of 10743 branches covered (77.81%)

26 of 27 new or added lines in 4 files covered. (96.3%)

16232 of 17289 relevant lines covered (93.89%)

29844.51 hits per line

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

88.89
/packages/cspell-tools/src/compiler/writeTextToFile.ts
1
import { Buffer } from 'node:buffer';
2
import { promises as fs } from 'node:fs';
3

4
import { compress } from '../gzip/index.js';
5

6
const isGzFile = /\.gz$/;
5✔
7

8
export async function writeTextToFile(
9
    filename: string,
10
    data: string | Iterable<string>,
11
    useGzCompress?: boolean,
12
): Promise<void> {
13
    const dataStr = typeof data === 'string' ? data : Array.isArray(data) ? data.join('') : [...data].join('');
47!
14
    const hasGzExt = isGzFile.test(filename);
47✔
15
    const useGz = useGzCompress ?? hasGzExt;
47✔
16
    if (useGz && !hasGzExt) {
47!
NEW
17
        filename += '.gz';
×
18
    }
19
    const buf = Buffer.from(dataStr, 'utf8');
47✔
20
    const buffer = useGz ? await compress(buf) : buf;
47✔
21
    await fs.writeFile(filename, buffer);
47✔
22
}
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