({ files })
| 18 | const RE = /export\s+const\s+dynamic\s*=\s*["']force-dynamic["']/; |
| 19 | |
| 20 | export function scan({ files }) { |
| 21 | const out = []; |
| 22 | for (const { path, content } of files) { |
| 23 | if (!isApplicable(path)) continue; |
| 24 | const m = RE.exec(content); |
| 25 | if (m) { |
| 26 | out.push({ |
| 27 | pattern: metadata.id, |
| 28 | file: path, |
| 29 | line: lineOf(content, m.index), |
| 30 | evidence: 'export const dynamic = "force-dynamic"', |
| 31 | trafficIndependent: metadata.trafficIndependent, |
| 32 | }); |
| 33 | } |
| 34 | } |
| 35 | return out; |
| 36 | } |
| 37 | |
| 38 | import { lineOf } from '../util.mjs'; |
| 39 |
no test coverage detected