Skip to content

Commit db2eca9

Browse files
committed
fix: remove deprecated substr usage
1 parent 085585b commit db2eca9

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

packages/app-backend-core/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function registerAppJob (options: AppRecordOptions, ctx: BackendContext) {
3131
}
3232

3333
// Find correct backend
34-
const baseFrameworkVersion = parseInt(options.version.substr(0, options.version.indexOf('.')))
34+
const baseFrameworkVersion = parseInt(options.version.substring(0, options.version.indexOf('.')))
3535
for (let i = 0; i < availableBackends.length; i++) {
3636
const backendOptions = availableBackends[i]
3737
if (backendOptions.frameworkVersion === baseFrameworkVersion) {

packages/app-frontend/src/features/inspector/DataField.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export default defineComponent({
161161
} else if (type === 'custom') {
162162
return this.field.value._custom.tooltip
163163
} else if (type.indexOf('native ') === 0) {
164-
return type.substr('native '.length)
164+
return type.substring('native '.length)
165165
} else {
166166
return null
167167
}

packages/shared-utils/src/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function replacer (key) {
195195
return val
196196
} else if (typeof val === 'string') {
197197
if (val.length > MAX_STRING_SIZE) {
198-
return val.substr(0, MAX_STRING_SIZE) + `... (${(val.length)} total length)`
198+
return val.substring(0, MAX_STRING_SIZE) + `... (${(val.length)} total length)`
199199
} else {
200200
return val
201201
}
@@ -350,7 +350,7 @@ export function getCustomFunctionDetails (func: Function): CustomState {
350350
// Trim any excess whitespace from the argument string
351351
const match = matches && matches[0]
352352
const args = typeof match === 'string'
353-
? `(${match.substr(1, match.length - 2).split(',').map(a => a.trim()).join(', ')})`
353+
? `(${match.substring(1, match.length - 2).split(',').map(a => a.trim()).join(', ')})`
354354
: '(?)'
355355
const name = typeof func.name === 'string' ? func.name : ''
356356
return {

packages/shell-dev-vue2/src/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default new Vuex.Store({
7878
state.foo += 'bar'
7979
},
8080
REMOVE_BAR: (state) => {
81-
state.foo = state.foo.substr('bar'.length)
81+
state.foo = state.foo.substring('bar'.length)
8282
},
8383
},
8484
},

0 commit comments

Comments
 (0)