Skip to content

fix(type): Lost related mapWithIndex methods in MapProxy type interface.#191

Merged
Aries0d0f merged 1 commit into
mainfrom
develop
Mar 27, 2026
Merged

fix(type): Lost related mapWithIndex methods in MapProxy type interface.#191
Aries0d0f merged 1 commit into
mainfrom
develop

Conversation

@Aries0d0f
Copy link
Copy Markdown
Member

@Aries0d0f Aries0d0f commented Mar 27, 2026

Summary by Sourcery

Bug Fixes:

  • Add back the MapProxy.mapWithIndex signature that includes the index argument in the callback type.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Mar 27, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Restores the missing mapWithIndex overload on the MapProxy interface so that index-aware mapping is correctly typed.

Updated class diagram for MapProxy interface with restored mapWithIndex overload

classDiagram
    class Map~K, V~ {
      <<interface>>
      +map<U, S>(callbackfn: function, thisArg: any): MapProxy~U, S~
      +mapWithIndex<U, S>(callbackfn: function, thisArg: any): MapProxy~U, S~
      +reduce<U>(callbackfn: function, initialValue: U): U
    }

    class MapProxy~K, V~ {
      <<interface>>
      +map<U, S>(callbackfn: function, thisArg: any): MapProxy~U, S~
      +mapWithIndex<U, S>(callbackfn: function, thisArg: any): MapProxy~U, S~
      +reduce<U>(callbackfn: function, initialValue: U): U
    }

    Map~K, V~ <|-- MapProxy~K, V~
Loading

File-Level Changes

Change Details Files
Add index-aware mapWithIndex signature to MapProxy type.
  • Extend MapProxy interface with a mapWithIndex method that includes the element index in the callback signature.
  • Ensure mapWithIndex returns a MapProxy with transformed key and value types inferred from the callback.
src/shared/libs/map.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Aries0d0f Aries0d0f merged commit 255d84b into main Mar 27, 2026
6 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.

1 participant