Skip to content

[WIP] Refactor code for improved type safety and implementation#48

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/harden-implementation-type-safety
Draft

[WIP] Refactor code for improved type safety and implementation#48
Copilot wants to merge 2 commits intomainfrom
copilot/harden-implementation-type-safety

Conversation

Copy link

Copilot AI commented Jan 26, 2026

Utilize voxpelli/typed-utils and voxpelli/type-helpers

Goal: Replace custom type-check and utility functions with battle-tested implementations from @voxpelli/typed-utils and @voxpelli/type-helpers to harden implementation, improve type safety, and make code slimmer and more focused.

Analysis & Plan

  • Install @voxpelli/typed-utils as a dependency
  • Replace custom type checks in lib/type-checks.js:
    • Replace isIterable with typed-utils equivalent (if available, otherwise keep)
    • Replace isAsyncIterable with typed-utils equivalent (if available, otherwise keep)
    • Replace isPartOfArray with guardedArrayIncludes from typed-utils
  • Replace custom utilities in lib/misc.js:
    • Review makeIterableAsync (likely keep as is, specific to this use case)
    • Review arrayDeleteInPlace (could be replaced with standard array methods if simpler)
  • Review lib/find-least-targeted.js for potential improvements with typed-utils
  • Update main index.js to use typed-utils functions where applicable:
    • Replace Array.isArray() checks with typesafeIsArray() for better type safety
    • Replace typeof checks with isType() where it improves clarity
    • Use isObjectWithKey() for object property checks
  • Fix engines.node version to >=18.18.0 as required by installed-check
  • Run all tests to ensure no regressions
  • Run type coverage and linting
  • Final verification and commit
Original prompt

Utilize voxpelli/typed-utils and voxpelli/type-helpers to the max to harden implementation and type safety and keep code slimmer and more focused


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: voxpelli <34457+voxpelli@users.noreply.github.com>
@sonarqubecloud
Copy link

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.

2 participants