chore: remove typeSocket assertion helper#653
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the typeSocket TypeScript assertion helper from count_target_bytes to eliminate lint/TS suppression comments, replacing it with direct type casts for the local “socket with extras” shape used to track byte stats.
Changes:
- Deleted the empty
typeSocket()assertion helper (and its@ts-expect-error/ eslint suppression comments). - Updated
countTargetBytesandgetTargetStatsto cast sockets tonet.Socket & Extraslocally. - Renamed parameters (
source→sourceSocket,socket→rawSocket) to avoid identifier conflicts after introducing local cast variables.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jirimoravcik
approved these changes
Apr 29, 2026
daniil-poletaev
approved these changes
Apr 29, 2026
bliuchak
added a commit
that referenced
this pull request
May 5, 2026
* feat!: update minimal supported version of Node.js to v20 (#638) * chore: remove typeSocket assertion helper (#653) * feat!: migrate from CJS to ESM (#654) * feat: upgrade typescript to v5 (#655) * feat!: replace nodeify by async/await (#656) * chore: format changelog markdown * docs: add new version info into changelog * chore: bump package version to a major one Close #637
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes linter warnings by removing
typeSocketassertion helper. Instead, we're gonna cast the type.Why: I don't want to add another linter suppression there. That's why I decided to remove this helper and just cast it in two places instead.