Skip to content

Conversation

prajwalkulkarni
Copy link
Contributor

Resolves #1087

Description

What is the purpose of this pull request?

This pull request:

  • Adds generics to improve type definitions of the mapArguments function.
  • Updates tests as per the improved type declarations.

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@Planeshifter Planeshifter changed the title refactor: improve type declarations for @stdlib/utils/map-arguments feat: improve type declarations for utils/map-arguments Mar 29, 2024
@Planeshifter Planeshifter self-requested a review October 6, 2024 20:34
@Planeshifter Planeshifter changed the title feat: improve type declarations for utils/map-arguments feat!: improve type declarations for utils/map-arguments Oct 14, 2024
@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Oct 14, 2024
@stdlib-bot
Copy link
Contributor

PR Commit Message

feat!: improve type declarations for `utils/map-arguments`

PR-URL: https://github.com/stdlib-js/stdlib/pull/2050
Closes: https://github.com/stdlib-js/stdlib/issues/1087

Co-authored-by: Philipp Burckhardt <[email protected]>
Co-authored-by: Prajwal Kulkarni <[email protected]>
Reviewed-by: Philipp Burckhardt <[email protected]>

Please review the above commit message and make any necessary adjustments.

@Planeshifter Planeshifter merged commit b74a08a into stdlib-js:develop Oct 14, 2024
8 checks passed
aayush0325 pushed a commit to aayush0325/stdlib that referenced this pull request Nov 11, 2024
This change significantly improves the type definition of the mapArguments
function, transitioning from broad 'Function' types to specific, generic types
and implementing conditional this context based on thisArg presence.

BREAKING CHANGE: function signature and return type now more strictly typed
The mapArguments function now uses generic types instead of 'Function', and its
return type depends on thisArg presence. 

Users should review and update their usage of mapArguments, particularly:

-   Ensure provided functions match the new, stricter type requirements
-   Update any type assertions or checks where mapArguments is used
-   Pay special attention to contexts where this binding is significant

PR-URL: stdlib-js#2050
Closes: stdlib-js#1087

Co-authored-by: Philipp Burckhardt <[email protected]>
Co-authored-by: Prajwal Kulkarni <[email protected]>
Reviewed-by: Philipp Burckhardt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready To Merge A pull request which is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: improve type declarations for @stdlib/utils/map-arguments

3 participants