From 84fa7cb521d298d696fcd3fa70b9a9b5187dadad Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Wed, 23 Mar 2022 21:58:00 +0100 Subject: [PATCH] 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 --- packages/graphql-playground-react/config/paths.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/graphql-playground-react/config/paths.js b/packages/graphql-playground-react/config/paths.js index 995e8a9cf..b335af517 100644 --- a/packages/graphql-playground-react/config/paths.js +++ b/packages/graphql-playground-react/config/paths.js @@ -14,7 +14,7 @@ const envPublicUrl = process.env.PUBLIC_URL function ensureSlash(path, needsSlash) { const hasSlash = path.endsWith('/') if (hasSlash && !needsSlash) { - return path.substr(path, path.length - 1) + return path.slice(0, -1) } else if (!hasSlash && needsSlash) { return `${path}/` } else {