return res.join(separator) } /** * Returns the pool size for a set of options * * @param {Options} [options = {}] * @returns {number} */ export function poolSize(options: Options = {}): number { const { adjectiveCount = 1, addAdverb = false } = options return (adjectives.length * adjectiveCount) * nouns.length * verbs.length * (addAdverb ? adverbs.length : 1) } /** * Returns the max length for a set of options * * @param {Options} [options = {}] * @returns {number} */ export function maxLength(options: Options = {}): number { const { adjectiveCount = 1, addAdverb = false, separator = '' } = options return (longest(adjectives).length * adjectiveCount) + (adjectiveCount * separator.length) + longest(nouns).length + separator.length + longest(verbs).length + (addAdverb ? longest(adverbs).length + separator.length : 0) } /** * Returns the min length for a set of options * * @param {Options} [options = {}] * @returns {number} */ export function minLength(options: Options = {}): number { const { adjectiveCount = 1, addAdverb = false, separator = '' } = options return (shortest(adjectives).length * adjectiveCount) + (adjectiveCount * separator.length) + shortest(nouns).length + separator.length + shortest(verbs).length + (addAdverb ? shortest(adverbs).length + separator.length : 0) } export default humanId