Repository navigation
fix: make shorten method to properly work with camelCase_aliases - #11283
Conversation
mguida22
left a comment
There was a problem hiding this comment.
This won't completely address the issue in #9544, since shorten can still produce identical outputs for different inputs.
For example
// these differ by visualFrameAsset vs virtualFrameAsset
shorten("SupplierStockInTransit__supplierStock__productVariant_customFields_visualFrameAsset")
shorten("SupplierStockInTransit__supplierStock__productVariant_customFields_virtualFrameAsset")
// and shorten produces the same result
"SuStInTr__suSt__prVacuFiviFrAs"To fully address the issue aliases probably need some kind of hash of their contents. I wonder how other ORMs handle this?
This PR might still be an improvement since it handles camel case aliases better than before.
PR Code Suggestions ✨Latest suggestions up to cfcdd94
Previous suggestionsSuggestions up to commit 7becb71
Suggestions up to commit 19fff0b
Suggestions up to commit de792a2
Suggestions up to commit 855e6c2
|
|||||||||||||||||||||||||||||||||||||||||||||||||
commit: |
shorten method to properly work with camelCase_aliasesshorten method to properly work with camelCase_aliases
|
Persistent review updated to latest commit 7becb71 |
Code Review by Qodo
1. Incomplete underscore splitting regex pattern
|
|
Persistent review updated to latest commit cfcdd94 |
michaelbromley
left a comment
There was a problem hiding this comment.
@mguida22's earlier comment stands - but this is certainly an improvement and will lower the chances of users running into this issue, so IMO certainly worth merging.
|
Actually @OSA413 would you be able to move the unit test for this to a better location as per Qodo's suggestion, so we move away from the issue-based test structure? update: I commented this at the exact moment that Giorgio merged.. but we discussed further and in any case there is still work to be done to clearly define and then move all the other tests. |
…ypeorm#11283) Co-authored-by: gioboa <[email protected]> Co-authored-by: Michael Bromley <[email protected]>
Fixes #9544
Description of change
Pull-Request Checklist
masterbranchnpm run formatto apply prettier formattingnpm run testpasses with this changeFixes #0000