1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

replacing the deprecated substr() with slice() (#4687)

This commit is contained in:
Gaurav Agrawal 2022-01-18 00:27:03 +05:30 committed by GitHub
parent eb93a2eee7
commit 66d0a354b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -140,7 +140,7 @@ export class CustomResourceDefinition extends KubeObject {
getResourceTitle() {
const name = this.getPluralName();
return name[0].toUpperCase() + name.substr(1);
return name[0].toUpperCase() + name.slice(1);
}
getGroup() {

View File

@ -22,7 +22,7 @@
// Create random system name
export function getRandId({ prefix = "", suffix = "", sep = "_" } = {}) {
const randId = () => Math.random().toString(16).substr(2);
const randId = () => Math.random().toString(16).slice(2);
return [prefix, randId(), suffix].filter(s => s).join(sep);
}