mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
kubeconfig-manager.ts fixes / refactoring
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
1 parent
40da87c0ef
commit
e7fc6b4a35
7 files changed
+80
-76
No files matched your search
@@ -1,5 +1,6 @@
|
||||
// Creates system valid random filename
|
||||
// Create random filename
|
||||
|
||||
export function randomFileName(name: string) {
|
||||
return `${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}-${name}`
|
||||
export function randomFileName({ prefix = "", suffix = "", sep = "__" } = {}) {
|
||||
const randId = () => Math.random().toString(16).substr(2);
|
||||
return [prefix, randId(), suffix].filter(s => s).join(sep);
|
||||
}
|
||||
Reference in new issue
Block a user