Refactor: use slice() instead of deprecated substr() to avoid future issues #111
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.
This Pull Request (PR) is created for issue #110 and needs review to merge it.
What does this PR do?
This pull request replaces all occurrences of the deprecated
substr()
method withslice()
in the codebase.Why is this needed?
The
substr()
method is deprecated and may lead to issues or warnings in future JavaScript versions. This update ensures the code remains future-proof and compliant with modern JavaScript standards.How does it address the issue?
Each instance of
substr()
has been refactored toslice()
to maintain the same functionality.Are there any side effects?
This change should not introduce any side effects. Both
substr()
andslice()
have similar behavior, with the exception of how they handle negative indices. All instances in the codebase have been reviewed to ensure compatibility.Additional Context
For more information on the deprecation of
substr()
, please refer to the MDN documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr.