Commit 8551720
committed
fix: add runtime guards for process and document (based on PR #62)
Applied fixes from PR #62 to enable Cloudflare Workers support.
Modified to work with current codebase which already removed
process.env.CI check from transformer.js.
Changes:
- Added document existence check in tryParseWithNativeDom
- Added defensive guards for process.env.LOG_PERF access
- Prevents crashes in environments without process/document globals
This fixes issue #42 (Cloudflare Workers compatibility) by using
runtime guards instead of build-time flags.
Related: PR #62, Issue #421 parent 8c5aa49 commit 8551720
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| 144 | + | |
| 145 | + | |
144 | 146 | | |
145 | 147 | | |
146 | 148 | | |
| |||
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
228 | | - | |
| 230 | + | |
229 | 231 | | |
230 | 232 | | |
231 | 233 | | |
232 | | - | |
| 234 | + | |
233 | 235 | | |
234 | 236 | | |
235 | 237 | | |
0 commit comments