Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(assign): typing Issues and add type-safety tests #158

Closed
wants to merge 13 commits into from
Closed

fix(assign): typing Issues and add type-safety tests #158

wants to merge 13 commits into from

Conversation

MarlonPassos-git
Copy link
Contributor

@MarlonPassos-git MarlonPassos-git commented Aug 7, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Currently, the typing of assign has some issues:

  • It does not handle two objects with different structures.
  • It does not correctly merge the typings.

This PR addresses these problems and adds a layer of type tests for the assign function, making it more type-safe.

Related issue, if any:

sodiray/radash#420

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

Bundle impact

Status File Size

MarlonPassos-git and others added 13 commits July 16, 2024 23:02
- Keep the tests in one file. Use `vi.resetModules` to check for correct behavior when globalThis.AggregateError is undefined and when it‘s not.

- Inline the polyfill so it‘s not instantiated unless necessary.

- Rename the local const to `AggregateErrorOrPolyfill` then use `export { … as … }` to export it as `AggregateError`. This prevents ESBuild from renaming the polyfill to `AggregateError2`, which it does to prevent variable shadowing.
@MarlonPassos-git
Copy link
Contributor Author

MarlonPassos-git commented Aug 7, 2024

/publish
 
Your preview release is being published.
 
Oops! Your preview release failed to publish. ❌

@aleclarson
Copy link
Member

Duplicate of #142, did you see that one? :)

Looking at what's going on with the preview releases. Thanks for testing!

@MarlonPassos-git
Copy link
Contributor Author

really XD, when I saw the issue I didn't find any markings so I didn't even check

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