import { UIDContent, UIDContentType, } from "@prismicio/types-internal/lib/content" import type { UID } from "@prismicio/types-internal/lib/customtypes" import type { WidgetMock } from ".." import type { MockConfig } from "../MockConfig" import { slug } from "../utils" export type UIDMockConfig = MockConfig function random(): string { return slug({ min: 3, max: 10 }) } export const UIDMock: WidgetMock = { generate(_def: UID, config?: UIDMockConfig): UIDContent { const value = config?.value || random() return { __TYPE__: UIDContentType, value, } }, }