Skip to content

chore: upgrade TypeScript and fixup types#927

Merged
broofa merged 7 commits into
uuidjs:mainfrom
jamiebuilds:upgrade-typescript
Apr 5, 2026
Merged

chore: upgrade TypeScript and fixup types#927
broofa merged 7 commits into
uuidjs:mainfrom
jamiebuilds:upgrade-typescript

Conversation

@jamiebuilds
Copy link
Copy Markdown
Contributor

I was trying to make use of uuid.parse() but the return type was Uint8Array instead of the Uint8Array<ArrayBuffer> type that Uint8Array.of() actually returns.

In order to keep it compatible with different versions of TypeScript'd definitions I've used:

type NonSharedArrayBuffer = ReturnType<typeof Uint8Array.of>;

Which then should be the correct type no matter what version of TypeScript someone is on

I also upgraded the version of TypeScript to double check that nothing would break, and I just had to fix one small type in v35()

@broofa
Copy link
Copy Markdown
Member

broofa commented Mar 16, 2026

Related to #856

Copy link
Copy Markdown
Member

@broofa broofa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Trying out using copilot to fix some of these issues. Not sure how that's going to work out, but we'll figure it out.] Nevermind. Copilot doesn't work on x-repository requests.

Thanks for the contribution. The NonSharedArrayBuffer type seems like a nice solution to the TS version problem, but something here broke the npm run test:node tests. Those will need to get fixed.

Comment thread src/parse.ts Outdated
Comment thread package.json Outdated
@jamiebuilds jamiebuilds requested a review from broofa March 17, 2026 01:12
@jamiebuilds
Copy link
Copy Markdown
Contributor Author

Oh sorry requested re-review before I fixed the tests, I'll look at that now

@jamiebuilds
Copy link
Copy Markdown
Contributor Author

Okay should all be fixed now

Comment thread src/v35.ts Outdated
@broofa broofa merged commit 529ef08 into uuidjs:main Apr 5, 2026
4 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.

2 participants