kubeconfig-manager.ts fixes / refactoring

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman committed 2020-07-12 12:49:11 +03:00
1 parent 40da87c0ef
commit e7fc6b4a35
7 files changed
+80 -76

No files matched your search

+4 -3
View File
@@ -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);
}