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

streetsidesoftware / regexp-worker / 15715712766

17 Jun 2025 06:51PM UTC coverage: 61.796% (-36.3%) from 98.11%
15715712766

Pull #962

github

web-flow
Merge 83a680833 into 48d572a05
Pull Request #962: feat: Bundle the worker

143 of 245 branches covered (58.37%)

Branch coverage included in aggregate %.

4 of 24 new or added lines in 5 files covered. (16.67%)

1 existing line in 1 file now uncovered.

373 of 590 relevant lines covered (63.22%)

90.08 hits per line

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

0.0
/scripts/build-worker.js
1
import fs from 'node:fs/promises';
2

3
async function run() {
NEW
4
    const workerURL = new URL('../lib/workerCodeNode.js', import.meta.url);
×
NEW
5
    const workerCode = await fs.readFile(workerURL, 'base64');
×
NEW
6
    const data = splitIntoLines(workerCode);
×
7

NEW
8
    const code = `
×
9
// This file is auto-generated. Do not edit manually.
10
// cspell\x3a disable
11

12
// eslint-disable-next-line quotes
NEW
13
export const workerCodeDataURL: string = \`data:application/javascript;base64,\\\n${data.map((line) => line + '\\\n').join('')}\`;
×
14
`;
15

NEW
16
    const outputURL = new URL('../src/worker/workerCodeDataURL.ts', import.meta.url);
×
NEW
17
    await fs.writeFile(outputURL, code, 'utf8');
×
18
}
19

20
/**
21
 *
22
 * @param {string} code
23
 * @returns {string[]}
24
 */
25
function splitIntoLines(code) {
NEW
26
    const lines = [];
×
NEW
27
    const lineLen = 80;
×
NEW
28
    let i = 0;
×
NEW
29
    for (i = 0; i + lineLen < code.length; i += lineLen) {
×
NEW
30
        lines.push(code.substring(i, i + lineLen));
×
31
    }
NEW
32
    if (i < code.length) {
×
NEW
33
        lines.push(code.substring(i));
×
34
    }
35

NEW
36
    return lines;
×
37
}
38

NEW
39
run();
×
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