Skip to content

Commit 84fa7cb

Browse files
committed
refactor: replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
1 parent 2077b6a commit 84fa7cb

File tree

1 file changed

+1
-1
lines changed
  • packages/graphql-playground-react/config

1 file changed

+1
-1
lines changed

packages/graphql-playground-react/config/paths.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const envPublicUrl = process.env.PUBLIC_URL
1414
function ensureSlash(path, needsSlash) {
1515
const hasSlash = path.endsWith('/')
1616
if (hasSlash && !needsSlash) {
17-
return path.substr(path, path.length - 1)
17+
return path.slice(0, -1)
1818
} else if (!hasSlash && needsSlash) {
1919
return `${path}/`
2020
} else {

0 commit comments

Comments
 (0)