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

marekdedic / rollup-plugin-htaccess / 9987592088

18 Jul 2024 07:47AM UTC coverage: 88.927% (-9.9%) from 98.805%
9987592088

Pull #50

github

marekdedic
Unified filesystem access functions
Pull Request #50: Added the ability to extract CSP from HTML <meta> tags

223 of 233 branches covered (95.71%)

14 of 44 new or added lines in 4 files covered. (31.82%)

257 of 289 relevant lines covered (88.93%)

281.15 hits per line

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

66.67
/src/utils.ts
1
import { readFile as nodeReadFile, writeFile as nodeWriteFile } from "fs";
2

3
export function escapeValue(value: string): string {
4
  return value.replace(/"/g, '\\"');
1,488✔
5
}
6

7
export async function readFile(path: string): Promise<string> {
8
  return new Promise<string>((resolve, reject) => {
792✔
9
    nodeReadFile(path, "utf8", (err, data) => {
792✔
10
      if (err !== null) {
792✔
11
        reject(err);
12✔
12
      }
13
      resolve(data);
792✔
14
    });
15
  });
16
}
17

18
export async function writeFile(path: string, contents: string): Promise<void> {
NEW
19
  return new Promise<void>((resolve) => {
×
NEW
20
    nodeWriteFile(path, contents, () => {
×
NEW
21
      resolve();
×
22
    });
23
  });
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