refactor: replace deprecated String.prototype.substr()#1237
refactor: replace deprecated String.prototype.substr()#1237CommanderRoot wants to merge 1 commit intoWorldBrain:developfrom
Conversation
.substr() is deprecated so we replace it with .slice() or .substring() which work similarily but aren't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
|
This looks good! Thanks for the contribution. |
|
The reason I used So to replicate the current behaviour I used |
Code Review: Replace deprecated String.prototype.substr()Summary: Modernizing codebase by replacing deprecated substr() calls with slice() and substring(). ✅ Changes AnalysisAll replacements are functionally correct and improve code quality:
🎯 Benefits
🔍 Testing RecommendationWhile these are low-risk changes, testing should focus on:
✅ Recommendation: APPROVEThis is a solid refactoring PR that:
Great contribution @CommanderRoot! 🙏 |
String.prototype.substr() is deprecated so we replace it with String.prototype.slice() or String.prototype.substring() which work similarily but aren't deprecated.
.substr() probably isn't going away anytime soon but the change is trivial so it doesn't hurt to do it.