Update quickSetup.ts

This commit is contained in:
DJj123dj
2025-06-20 15:59:52 +02:00
parent c2e6f781b9
commit b2f2ef3405
+1 -1
View File
@@ -7,7 +7,7 @@ import {renderHeader, terminate} from "./cli"
function generateUniqueIdFromName(name:string){
//id only allows a-z, 0-9 & dash characters (& replace spaces with dashes)
const filteredChars = name.replaceAll(" ","-").split("").filter((ch) => /^[a-zA-Z0-9-]{1}$/.test(ch))
const filteredChars = name.toLowerCase().replaceAll(" ","-").split("").filter((ch) => /^[a-zA-Z0-9-]{1}$/.test(ch))
const randomSuffix = "-"+crypto.randomBytes(4).toString("hex")
return filteredChars.join("")+randomSuffix
}