Skip to content

Preserve typed-array return types for heap selections - #265

Closed
Aschenbath wants to merge 1 commit into
Yomguithereal:masterfrom
Aschenbath:codex/oss20e-20261122-mnemonist-heap-types
Closed

Aschenbath wants to merge 1 commit into
Yomguithereal:masterfrom
Aschenbath:codex/oss20e-20261122-mnemonist-heap-types

Conversation

@Aschenbath

Copy link
Copy Markdown

Fixes #121 for the nsmallest/nlargest helpers.

Add typed-array overloads before the generic iterable overloads, using the input slice return type to match the existing runtime result. Arrays and other iterables keep their existing array return types; comparator arguments remain numeric for typed arrays. This avoids changing the shared ArrayLike abstraction used by unrelated containers.

Validation: the new strict TypeScript fixture failed before the declarations changed and passes afterwards. Existing runtime suite: 564 passing, one pending. No JavaScript runtime changes.

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.

Should type ArrayLike be generic

2 participants