Skip to content

TS => MJS: basen/base128 - #1463

Merged
sergey-shandar merged 4 commits into
mainfrom
fjs/basen/base128
Aug 9, 2026
Merged

TS => MJS: basen/base128#1463
sergey-shandar merged 4 commits into
mainfrom
fjs/basen/base128

Conversation

@sergey-shandar

Copy link
Copy Markdown
Contributor

Continues the TypeScript-to-.mjs migration.

  • Renames fjs/basen/base128/module.f.ts to module.f.mjs, converting type annotations to JSDoc (@param/@returns) and the Vec type import to @import.
  • Updates importers (fjs/asn.1/module.f.ts, fjs/basen/base128/proof.f.ts) to the new .mjs path.

No behavior changes.

🤖 Generated with Claude Code

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
functionalscript 4a869a9 Commit Preview URL

Branch Preview URL
Aug 09 2026, 05:52 AM

@o2alexanderfedin o2alexanderfedin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving. Small, clean migration — proper rename, CHANGELOG entry present, two importers updated.

Signatures are preserved exactly, checked with a strict Equal<A,B> against the pre-migration types rather than by reading:

typeof encode === (uint: bigint) => Vec                    ✓
typeof decode === (v: Vec) => readonly[bigint, Vec]        ✓

and they're genuinely enforced — encode(5), encode(5n) assigned to string, and decode(5n) each produce the right specific error, so nothing collapsed to any.

npx tsc clean, npm testpass: 2354, fail: 0, total: 2354, CI 19/19.

No typedefs in this module, so the new _ convention has nothing to apply to here — worth noting only because this is the first migration since #1462 landed it.

One small thing done well: keeping @param / @returns rather than collapsing to a single @type preserves the parameter names and descriptions the original TypeScript JSDoc carried. A @type annotation would have type-checked identically but dropped "The bigint to encode" and "The MSB Base128 vector to decode" from the emitted declarations.

@sergey-shandar
sergey-shandar added this pull request to the merge queue Aug 9, 2026
Merged via the queue into main with commit 810318f Aug 9, 2026
19 checks passed
@sergey-shandar
sergey-shandar deleted the fjs/basen/base128 branch August 9, 2026 14:23
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