Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace deprecated String.prototype.substr() #646

Merged
merged 1 commit into from Jun 6, 2022
Merged

refactor: replace deprecated String.prototype.substr() #646

merged 1 commit into from Jun 6, 2022

Conversation

lamweili
Copy link
Contributor

@lamweili lamweili commented Jun 4, 2022

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behaviour

Deprecated String.prototype.substr() is used.

New behaviour

String.prototype.slice() is used instead.

Other information (e.g. related issues)

Apart from changing all String.prototype.substr() to String.prototype.slice(), also changed String.prototype.substring() to String.prototype.slice() for consistency so there are no two different functions that are doing the essentially the same thing.

In addition, removed // eslint-disable-line node/no-deprecated-api as it is redundant following PR #565.

`.substr()` is deprecated so we replace it with `.slice()` which works similarily but isn't deprecated

Signed-off-by: Lam Wei Li <peteriman@mail.com>
@darrachequesne darrachequesne merged commit 917d1d2 into socketio:main Jun 6, 2022
@darrachequesne
Copy link
Member

@peteriman thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants