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:
parent
eb93a2eee7
commit
66d0a354b1
@ -140,7 +140,7 @@ export class CustomResourceDefinition extends KubeObject {
|
|||||||
getResourceTitle() {
|
getResourceTitle() {
|
||||||
const name = this.getPluralName();
|
const name = this.getPluralName();
|
||||||
|
|
||||||
return name[0].toUpperCase() + name.substr(1);
|
return name[0].toUpperCase() + name.slice(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
getGroup() {
|
getGroup() {
|
||||||
|
|||||||
@ -22,7 +22,7 @@
|
|||||||
// Create random system name
|
// Create random system name
|
||||||
|
|
||||||
export function getRandId({ prefix = "", suffix = "", sep = "_" } = {}) {
|
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);
|
return [prefix, randId(), suffix].filter(s => s).join(sep);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user