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(useChangeCase): use the exported key for filter #4130

Merged
merged 3 commits into from
Aug 13, 2024

Conversation

thyngster
Copy link
Contributor

@thyngster thyngster commented Aug 3, 2024

changeCaseTransforms will return a null object of funcions becasue on the non-dev build the functions names comes minified/mangles,

changeCase VALUES 
(14) [ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ]
ƒ ir(t,e)
ƒ yt(t,e)
ƒ lr(t,e)
ƒ sr(t,e)
ƒ ur(t,e)
ƒ Oe(t,e)
ƒ or(t,e)
ƒ ar(t,e)
ƒ cr(t,e)
ƒ dr(t,e)
ƒ fr(t,e)
ƒ Et(t)
ƒ Kt(t)
ƒ hr(t,e)

making the v.name.endsWith('Case') never maching.

Not sure this is the best aproach to fix. changed Object.values to use Object.entries in other to be able to use theyh object key instead of the function name.

Issue: #4139
Duplicate PR: #4140

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 3, 2024
@thyngster
Copy link
Contributor Author

It seems I didnt linted before uploading ...

@zyyv
Copy link
Contributor

zyyv commented Aug 8, 2024

Sorry to see this PR, I didn't see it linked to the issue, so I made a duplicate version #4140. If you are willing to change the title and link it to the issue #4139, I will close my PR. Thank you.

Our solution is consistent, I am sure it actually solves the problem and I have verified it in the production environment. function.name will be compressed and cause the judgment to fail, we should use key to handle it.

@thyngster thyngster changed the title Fix Case Transforms Filtering fix(useChangeCase): use the exported key for filter Aug 8, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 13, 2024
@antfu antfu enabled auto-merge August 13, 2024 14:10
@antfu antfu added this pull request to the merge queue Aug 13, 2024
Merged via the queue into vueuse:main with commit 5c598f1 Aug 13, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants