[code-simplifier] Simplify URL normalization logic in CDN utilities#18062
Draft
github-actions[bot] wants to merge 1 commit intomasterfrom
Draft
[code-simplifier] Simplify URL normalization logic in CDN utilities#18062github-actions[bot] wants to merge 1 commit intomasterfrom
github-actions[bot] wants to merge 1 commit intomasterfrom
Conversation
Improved code clarity in recently modified URL processing methods: - Replace verbose substring operations with cleaner endsWith() and slice() - Use template literals for string concatenation - Apply consistent pattern across GetAssetUrl, GetBabylonScriptURL, and GetWasmUrl These changes improve readability without altering functionality. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code Simplification - 2026-03-10
This PR simplifies recently modified code to improve clarity, consistency, and maintainability while preserving all functionality.
Files Simplified
packages/dev/core/src/Misc/tools.ts- Simplified URL normalization inGetAssetUrlandGetBabylonScriptURLmethodspackages/tools/ktx2Decoder/src/transcoder.ts- Simplified URL normalization inGetWasmUrlmethodImprovements Made
Enhanced Clarity
str[str.length - 1] === "/"checks with cleanerstr.endsWith("/")substring(0, str.length - 1)with more conciseslice(0, -1)Improved Consistency
Preserved Functionality
Changes Based On
Recent changes from:
Code Examples
Before:
After:
Testing
Review Focus
Please verify:
Automated by Code Simplifier Agent - analyzing code from the last 24 hours