Skip to content

Comments

fix(useChangeCase): use the exported key for filter#4130

Merged
antfu merged 3 commits intovueuse:mainfrom
thyngster:fix-caseName-Filtering
Aug 13, 2024
Merged

fix(useChangeCase): use the exported key for filter#4130
antfu merged 3 commits intovueuse:mainfrom
thyngster:fix-caseName-Filtering

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
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