Convert internal functional-red-black-tree fork to TypeScript#23
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Converts the vendored functional-red-black-tree implementation from a JS + hand-written .d.ts pair into a single TypeScript source, and updates internal persistent-map utilities to consume the new named exports—resolving downstream TS import/type errors reported in Issue #22.
Changes:
- Replace
src/vendor/functional-red-black-tree.js+.d.tswith a TypeScript implementation exportingRedBlackTree(and related types). - Update
SeqMapandLeafMapto useRedBlackTree.new(...)instead of a default-export factory +Treetype. - Add a dedicated vendored red-black-tree test suite to validate persistence and invariants.
Reviewed changes
Copilot reviewed 4 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/vendor/functional-red-black-tree.test.ts | Adds invariant + behavioral tests for the vendored red-black-tree subset API. |
| src/vendor/functional-red-black-tree.ts | New TypeScript implementation of the vendored functional red-black tree (named exports). |
| src/vendor/functional-red-black-tree.js | Removes the prior JS implementation in favor of the TS version. |
| src/vendor/functional-red-black-tree.d.ts | Removes the prior hand-maintained type declarations (now emitted from TS). |
| src/internal/seq_map.ts | Switches from default import + Tree type to RedBlackTree named export. |
| src/internal/leaf_map.ts | Switches from default import + Tree type to RedBlackTree named export. |
| src/id_list.ts | Minor import reordering + adds @private doc annotations for internal/test-only exports. |
| .prettierrc | Adds an explicit Prettier config file (empty config). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #22