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 {