MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / generateSlug

Function generateSlug

packages/utilities/src/randomWordSlugs.ts:442–449  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

440const order = ['adjective', 'noun', 'numbers'];
441
442export function generateSlug() {
443 const selected = order.map((partOfSpeech) => {
444 const choices = words[partOfSpeech];
445 return choices[Math.floor(Math.random() * choices.length)];
446 });
447 const slug = selected.join('-');
448 return slug;
449}
450
451export function totalUniqueSlugs() {
452 const numAdjectives = adjective.length;

Callers 2

generateRandomWordSlugFunction · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected