1import getUuidByString from 'uuid-by-string'2import type { NoDashesUuid } from './idTypesF.mts'4export function removeDashes(str: string): NoDashesUuid5export function removeDashes(str: string | null | undefined): NoDashesUuid | null | undefined6export function removeDashes(str: string | null | undefined): NoDashesUuid | null | undefined {7 if (!str) return str as NoDashesUuid | null | undefined8 return str.replace(/-/g, '') as NoDashesUuid9}11export const genUuid = (str: string): NoDashesUuid => {12 if (Array.isArray(str)) {13 str = str.join('-')14 }15 return removeDashes(getUuidByString(str))16}