function generateUniqueSlug
generateUniqueSlug<Index extends string>(
computeIndex: ComputeIndex<Index>,
isTaken: IsTaken,
): Promise<SlugWithIndex<Index>>

Generate a unique slug by retrying random slugs until one is not taken.

Type Parameters

Index extends string

Parameters

computeIndex: ComputeIndex<Index>
  • hash the slug for blind-index lookup
isTaken: IsTaken
  • check cross-table uniqueness

Return Type

Usage

import { generateUniqueSlug } from "docs/utilities.ts";