Skip to content

fix: use callable type for injected fetch#886

Open
rksharma-owg wants to merge 2 commits into
OWASP:mainfrom
rksharma-owg:codex/885-fetch-callable-type
Open

fix: use callable type for injected fetch#886
rksharma-owg wants to merge 2 commits into
OWASP:mainfrom
rksharma-owg:codex/885-fetch-callable-type

Conversation

@rksharma-owg

Copy link
Copy Markdown

What changed and why

Replace typeof fetch at fetch-injection boundaries with a focused FetchLike callable contract. Current Node 24 typings add a static preconnect member to typeof fetch, so the cert-aware async wrapper no longer satisfied that platform-specific type and clean builds failed with TS2741.

The new type captures only the request call signature used by CVE Lite. It is threaded through the advisory, scanner, multi-folder, registry, and CLI injection points without changing runtime behavior. A regression test verifies that OSV scanning accepts a callable implementation with no preconnect static member.

Validation:

  • npm test -- --runInBand — 101 suites, 1,180 tests passed
  • npm run build — passed, including distribution checks
  • git diff --check — passed

Closes #885

@rksharma-owg
rksharma-owg requested a review from sonukapoor as a code owner July 23, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Build fails when cert-aware fetch wrapper is checked against current Node typings

2 participants