Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

TypeScript definitions incorrectly documented UTF-32 decoding functions as throwing on "non-even byte length" when they actually validate byteLength % 4 !== 0.

Changes

  • utf32.d.ts: Updated documentation comments (lines 61, 80) to state "Throws on byte length not a multiple of 4"

UTF-32 uses 4 bytes per codepoint. The implementation in utf32.js correctly validates multiples of 4, but the type definitions were left with incorrect documentation after a previous fix to the error messages.

Original prompt

This section details on the original issue you should resolve

<issue_title>Review the codebase and identify mistakes</issue_title>
<issue_description>Ignore tests/wpt and other vendored tests

Note: wif using synchronous path for async implementation is not an issue, it's done for perf, as underlying method is always sync (again, for perf).</issue_description>

Comments on the Issue (you are @copilot in this section)


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

Co-authored-by: ChALkeR <291301+ChALkeR@users.noreply.github.com>
Copilot AI changed the title [WIP] Review codebase and identify mistakes Fix utf32.d.ts: byte length validation documentation Jan 28, 2026
Copilot AI requested a review from ChALkeR January 28, 2026 13:07
@ChALkeR ChALkeR changed the title Fix utf32.d.ts: byte length validation documentation doc: utf32.d.ts byte length validation documentation Jan 28, 2026
@ChALkeR ChALkeR changed the title doc: utf32.d.ts byte length validation documentation doc: utf32toString byte length validation documentation Jan 28, 2026
@ChALkeR ChALkeR marked this pull request as ready for review January 28, 2026 13:17
@ChALkeR ChALkeR merged commit 2a1076d into main Jan 28, 2026
30 checks passed
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.

Review the codebase and identify mistakes

2 participants