@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
14 lines (10 loc) • 450 B
text/typescript
import { names, prefixes, suffixes } from '.'
import { choice } from '@/utilities/arrays'
import { weightedNumber, coinflip } from '@/utilities/math'
const generateStarName = (): string => {
const prefix = choice(prefixes).replace('RANDOM', weightedNumber().toString())
const name = choice(names)
const suffix = coinflip(0.6) ? choice(suffixes) : ''
return [prefix, name, suffix].join('-').replace(/-+$/, '')
}
export { generateStarName }