You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ uniqueSpaceSlug, color, digits }from'space-slug';constslug=awaituniqueSpaceSlug([color(1),digits(4),],{usedSlugs: ['orange-3918']});// Returns: a slug that is not orange-3918
✅ Verifying that a slug is a unique
const{ uniqueSpaceSlug }from'space-slug';awaituniqueSpaceSlug([],{maxAttempts: 10,// default is 10 attempts before throwing an errorisUnique: async(slug)=>{// check database to see if slug is uniquereturntrue;}});// Returns: a slug that you have verified is unique
🦄 Making a slug unique
awaituniqueSpaceSlug(['jabba'],{isUnique: async(slug)=>{// a db lookup to see if slug is uniquereturnfalse;},makeUnique: async(slug)=>{// somehow make the slug uniquereturnslug+'-hutt';}});