Commit d09ca0c
refactor: replace JSDOM with Cheerio for HTML parsing (#5)
* refactor: replace JSDOM with Cheerio for HTML parsing in browser and Node.js environments
- Updated package.json to include Cheerio as a dependency and modified the test command to include coverage.
- Refactored csp-generator.browser.ts to use Cheerio for parsing HTML instead of DOMParser, allowing for better compatibility in Node.js/Bun environments.
- Updated csp-generator.ts to utilize Cheerio for parsing and extracting resource references, replacing JSDOM usage.
- Removed JSDOM setup from browser tests and adjusted tests to work with the new Cheerio implementation.
* Update test/csp-generator.browser.test.ts
Co-authored-by: Copilot <[email protected]>
---------
Co-authored-by: Copilot <[email protected]>1 parent a7f7b16 commit d09ca0c
File tree
5 files changed
+193
-231
lines changed- src
- test
5 files changed
+193
-231
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | 56 | | |
58 | | - | |
59 | | - | |
| 57 | + | |
| 58 | + | |
60 | 59 | | |
61 | 60 | | |
62 | 61 | | |
| |||
0 commit comments