1 import short, { uuid } from 'short-uuid'
3 const translator = short()
5 function buildUUID () {
9 function uuidToShort (uuid: string) {
10 if (!uuid) return uuid
12 return translator.fromUUID(uuid)
15 function shortToUUID (shortUUID: string) {
16 if (!shortUUID) return shortUUID
18 return translator.toUUID(shortUUID)
21 function isShortUUID (value: string) {
22 if (!value) return false
24 return value.length === translator.maxLength