Files
speckle-server/packages/server/modules/core/helpers/testHelpers.ts
T
Chuck Driesler 0f5c22329b Chuck/web 3465 auto join discoverable workspace setting (#4791)
* feat(workspaces): enable toggle for auto-join discoverable workspaces

* fix(workspaces): include auto-join flag on LimitedWorkspace

* chore(workspaces): gqlgen
2025-05-22 10:11:05 +01:00

26 lines
603 B
TypeScript

import crs from 'crypto-random-string'
/**
* Returns a random email from example.org domain
*/
export function createRandomEmail() {
return randomizeCase(`${crs({ length: 6 })}@example.org`)
}
export function createRandomPassword(length?: number) {
return crs({ length: length ?? 10 })
}
/**
* @deprecated use the one in shared
*/
export function createRandomString(length?: number) {
return crs({ length: length ?? 10 })
}
export const randomizeCase = (str: string) =>
str
.split('')
.map((char) => (Math.random() > 0.5 ? char.toUpperCase() : char.toLowerCase()))
.join('')