(taken: ReadonlySet<string>)
| 130 | const shortId = (): string => Math.random().toString(36).slice(2, 8); |
| 131 | |
| 132 | export const freshCustomAuthSlug = (taken: ReadonlySet<string>): string => { |
| 133 | let candidate = `custom_${shortId()}`; |
| 134 | while (taken.has(candidate)) candidate = `custom_${shortId()}`; |
| 135 | return candidate; |
| 136 | }; |
| 137 | |
| 138 | export const mergeAuthTemplates = <T extends { readonly slug: string }>( |
| 139 | existing: readonly T[], |
no test coverage detected