Skip to content

chore: replace deprecated String.prototype.substr() #16350

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

Merged
merged 2 commits into from
Mar 18, 2022
Merged

chore: replace deprecated String.prototype.substr() #16350

merged 2 commits into from
Mar 18, 2022

Conversation

CommanderRoot
Copy link
Contributor

Why:

String.prototype.substr() is deprecated so we replace it with String.prototype.slice() which works similarily but isn't deprecated.
.substr() probably isn't going away anytime soon but the change is trivial so it doesn't hurt to do it.

What's being changed:

On one line substr(1) is being changed to slice(1). Both return the same values.

Check off the following:

  • I have reviewed my changes in staging (look for "Automatically generated comment" and click Modified to view your latest changes).
  • For content changes, I have completed the self-review checklist.

Writer impact (This section is for GitHub staff members only):

  • This pull request impacts the contribution experience
    • I have added the 'writer impact' label
    • I have added a description and/or a video demo of the changes below (e.g. a "before and after video")

.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
@CommanderRoot CommanderRoot requested a review from a team as a code owner March 18, 2022 09:55
@welcome
Copy link

welcome bot commented Mar 18, 2022

Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions
Copy link
Contributor

👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions. The complete list of files we can't accept are:
.devcontainer/**
.github/actions-scripts/**
.github/workflows/**
.github/CODEOWNERS
assets/fonts/**
data/graphql/**
Dockerfile*
lib/graphql/**
lib/redirects/**
lib/rest/**
lib/webhooks/**
lib/search/indexes/**
package*.json
scripts/**
translations/**
content/actions/deployment/security-hardening-your-deployments/**

You'll need to revert all of the files you changed in that list using GitHub Desktop or git checkout origin/main <file name>. Once you get those files reverted, we can continue with the review process. :octocat:

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team label Mar 18, 2022
@ramyaparimi ramyaparimi added engineering Will involve Docs Engineering content This issue or pull request belongs to the Docs Content team and removed triage Do not begin working on this issue until triaged by the team labels Mar 18, 2022
@ramyaparimi
Copy link
Contributor

@CommanderRoot
Thanks so much for opening a PR! I'll get this triaged for review ⚡

Copy link
Member

@rsese rsese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you 👍 !

@rsese rsese enabled auto-merge March 18, 2022 19:28
@github-actions
Copy link
Contributor

👋 Hey there spelunker. It looks like you've modified some files that we can't accept as contributions. The complete list of files we can't accept are:
.devcontainer/**
.github/actions-scripts/**
.github/workflows/**
.github/CODEOWNERS
assets/fonts/**
data/graphql/**
Dockerfile*
lib/graphql/**
lib/redirects/**
lib/rest/**
lib/webhooks/**
lib/search/indexes/**
package*.json
scripts/**
translations/**
content/actions/deployment/security-hardening-your-deployments/**

You'll need to revert all of the files you changed in that list using GitHub Desktop or git checkout origin/main <file name>. Once you get those files reverted, we can continue with the review process. :octocat:

@rsese rsese merged commit dd29668 into github:main Mar 18, 2022
@github-actions
Copy link
Contributor

Thanks very much for contributing! Your pull request has been merged 🎉 You should see your changes appear on the site in approximately 24 hours. If you're looking for your next contribution, check out our help wanted issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content This issue or pull request belongs to the Docs Content team engineering Will involve Docs Engineering
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants