(taken: ReadonlySet<string>)
| 122 | const shortId = (): string => Math.random().toString(36).slice(2, 8); |
| 123 | |
| 124 | export const freshCustomAuthSlug = (taken: ReadonlySet<string>): string => { |
| 125 | let candidate = `custom_${shortId()}`; |
| 126 | while (taken.has(candidate)) candidate = `custom_${shortId()}`; |
| 127 | return candidate; |
| 128 | }; |
| 129 | |
| 130 | export const mergeAuthTemplates = <T extends { readonly slug: string }>( |
| 131 | existing: readonly T[], |
no test coverage detected