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

This commit is contained in:
Gaurav Agrawal authored and GitHub committed 2022-01-17 13:57:03 -05:00
1 parent eb93a2eee7
commit 66d0a354b1
2 files changed
+2 -2

No files matched your search

+1 -1
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() {
+1 -1
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);
}