Rocket.Chat
Rocket.Chat copied to clipboard
chore: Replace `substr()` with `slice()` across the codebase (cont. from issue #340007)
-
[x] I have read the Contributing Guide - https://github.com/RocketChat/Rocket.Chat/blob/develop/.github/CONTRIBUTING.md#contributing-to-rocketchat doc
-
[x] I have signed the CLA - https://cla-assistant.io/RocketChat/Rocket.Chat
-
[x] Lint and unit tests pass locally with my changes
This pull request replaces all instances of the deprecated substr()
method with the modern and recommended slice()
method throughout the Rocket.Chat codebase.
Rationale
- The
substr()
method is considered a legacy feature and may not be supported in future JavaScript implementations. - The
slice()
method offers equivalent functionality for most use cases, aligning with modern JavaScript best practices.
Changes Made
- Replaced all occurrences of
substr()
withslice()
. - Verified functional equivalence to ensure no regressions were introduced.
Steps to Test
- Run the application locally and navigate through all major features to confirm they work as expected.
- Execute the unit and integration tests to validate functionality.
This change does not introduce new functionality or fix bugs; it is strictly a refactor to improve maintainability and align with current standards.