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

Use .substring() instead of the deprecated .substr() #339

Open
InSyncWithFoo opened this issue Dec 9, 2023 · 0 comments · May be fixed by #340
Open

Use .substring() instead of the deprecated .substr() #339

InSyncWithFoo opened this issue Dec 9, 2023 · 0 comments · May be fixed by #340

Comments

@InSyncWithFoo
Copy link

.substr() is deprecated. .substring() should be used instead. Conveniently, the differences between these two methods have already been handled by the conditional checks.

The following lines are affected:

json5/lib/stringify.js

Lines 50 to 57 in de344f0

if (typeof space === 'number') {
if (space > 0) {
space = Math.min(10, Math.floor(space))
gap = ' '.substr(0, space)
}
} else if (typeof space === 'string') {
gap = space.substr(0, 10)
}

@InSyncWithFoo InSyncWithFoo linked a pull request Dec 9, 2023 that will close this issue
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 a pull request may close this issue.

1 participant