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

refactor: replace deprecated String.prototype.substr() #1335

Merged
merged 1 commit into from May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .test-todo/test-ssr-composition/src/entry-server.js
Expand Up @@ -5,7 +5,7 @@ import { createApp } from './main'
const prepareUrlForRouting = url => {
const { BASE_URL } = process.env
return url.startsWith(BASE_URL.replace(/\/$/, ''))
? url.substr(BASE_URL.length)
? url.slice(BASE_URL.length)
: url
}

Expand Down
2 changes: 1 addition & 1 deletion .test-todo/test-ssr-composition/src/vue-apollo.js
Expand Up @@ -7,7 +7,7 @@ const AUTH_TOKEN = 'apollo-token'
// Http endpoint
const httpEndpoint = process.env.VUE_APP_GRAPHQL_HTTP || 'http://localhost:4042/graphql'
// Files URL root
export const filesRoot = process.env.VUE_APP_FILES_ROOT || httpEndpoint.substr(0, httpEndpoint.indexOf('/graphql'))
export const filesRoot = process.env.VUE_APP_FILES_ROOT || httpEndpoint.substring(0, httpEndpoint.indexOf('/graphql'))

Vue.prototype.$filesRoot = filesRoot

Expand Down
2 changes: 1 addition & 1 deletion .test-todo/test-ssr/src/entry-server.js
Expand Up @@ -5,7 +5,7 @@ import { createApp } from './main'
const prepareUrlForRouting = url => {
const { BASE_URL } = process.env
return url.startsWith(BASE_URL.replace(/\/$/, ''))
? url.substr(BASE_URL.length)
? url.slice(BASE_URL.length)
: url
}

Expand Down
2 changes: 1 addition & 1 deletion .test-todo/test-ssr/src/vue-apollo.js
Expand Up @@ -13,7 +13,7 @@ const AUTH_TOKEN = 'apollo-token'
// Http endpoint
const httpEndpoint = process.env.VUE_APP_GRAPHQL_HTTP || 'http://localhost:4042/graphql'
// Files URL root
export const filesRoot = process.env.VUE_APP_FILES_ROOT || httpEndpoint.substr(0, httpEndpoint.indexOf('/graphql'))
export const filesRoot = process.env.VUE_APP_FILES_ROOT || httpEndpoint.substring(0, httpEndpoint.indexOf('/graphql'))

Vue.prototype.$filesRoot = filesRoot

Expand Down
2 changes: 1 addition & 1 deletion packages/vue-apollo-util/src/errorLog.ts
Expand Up @@ -48,7 +48,7 @@ export function logErrorMessages (error: ApolloError | ErrorResponse, printStack
if (stack == null) return

const newLineIndex = stack.indexOf('\n')
stack = stack.substr(stack.indexOf('\n', newLineIndex + 1))
stack = stack.slice(stack.indexOf('\n', newLineIndex + 1))
console.log(`%c${stack}`, 'color:grey;')
}
}
Expand Down