if (Math.random() < .5)
user = user.map(name => name.toLowerCase())
user = user.join(
- data.separators[
- Math.floor(Math.random() * data.separators.length)
+ data.email_separators[
+ Math.floor(Math.random() * data.email_separators.length)
]
)
- let domain_name = data.domain_names[
- Math.floor(Math.random() * data.domain_names.length)
+ let email_domain = data.email_domains[
+ Math.floor(Math.random() * data.email_domains.length)
]
- let email = `${user}@${domain_name}`
+ let email = `${user}@${email_domain}`
+
+ let company_prefix =
+ Math.random() < .5 ?
+ data.company_prefixes[
+ Math.floor(Math.random() * data.company_prefixes.length)
+ ] :
+ data.family_names[
+ Math.floor(Math.random() * data.family_names.length)
+ ] + (
+ Math.random() < .5 ?
+ '' :
+ ' & ' + data.family_names[
+ Math.floor(Math.random() * data.family_names.length)
+ ]
+ )
+ let company_suffix = data.company_suffixes[
+ Math.floor(Math.random() * data.company_suffixes.length)
+ ]
+ if (company_suffix.charAt(0) === '&')
+ company_prefix = company_prefix.replaceAll(' & ', ', ')
+ let company = `${company_prefix} ${company_suffix}`
let expires = new XDate(env.now)
expires.addDays(1)
given_names: given_name,
family_name,
email,
+ company: company,
expires: expires.getTime()
}
session.set_json('placeholder', placeholder)