TS => MJS: basen/base128 - #1463
Conversation
Deploying with
|
| 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 |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
o2alexanderfedin
left a comment
There was a problem hiding this comment.
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 test → pass: 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.
Continues the TypeScript-to-
.mjsmigration.fjs/basen/base128/module.f.tstomodule.f.mjs, converting type annotations to JSDoc (@param/@returns) and theVectype import to@import.fjs/asn.1/module.f.ts,fjs/basen/base128/proof.f.ts) to the new.mjspath.No behavior changes.
🤖 Generated with Claude Code