@@ -12,8 +12,8 @@ export class CompanyModule {
1212 * @example faker.company.name() // 'TechCorp Inc'
1313 */
1414 name ( ) : string {
15- const name = this . random . arrayElement ( this . locale . company . name )
16- const suffix = this . random . arrayElement ( this . locale . company . suffix )
15+ const name = this . random . arrayElement ( this . locale . company . name ?? [ "Company" ] )
16+ const suffix = this . random . arrayElement ( this . locale . company . suffix ?? [ "Inc" , "LLC" , "Corp" ] )
1717 return `${ name } ${ suffix } `
1818 }
1919
@@ -22,25 +22,25 @@ export class CompanyModule {
2222 * @example faker.company.suffix() // 'Inc'
2323 */
2424 suffix ( ) : string {
25- return this . random . arrayElement ( this . locale . company . suffix )
25+ return this . random . arrayElement ( this . locale . company . suffix ?? [ "Inc" , "LLC" , "Corp" ] )
2626 }
2727
2828 /**
2929 * Generate a random industry
3030 * @example faker.company.industry() // 'Technology'
3131 */
3232 industry ( ) : string {
33- return this . random . arrayElement ( this . locale . company . industry )
33+ return this . random . arrayElement ( this . locale . company . industry ?? [ "Technology" ] )
3434 }
3535
3636 /**
3737 * Generate a random company catchphrase
3838 * @example faker.company.catchphrase() // 'Innovative cloud-based solutions'
3939 */
4040 catchphrase ( ) : string {
41- const adjective = this . random . arrayElement ( this . locale . company . adjective )
42- const descriptor = this . random . arrayElement ( this . locale . company . descriptor )
43- const noun = this . random . arrayElement ( this . locale . company . noun )
41+ const adjective = this . random . arrayElement ( this . locale . company . adjective ?? [ "innovative" ] )
42+ const descriptor = this . random . arrayElement ( this . locale . company . descriptor ?? [ "digital" ] )
43+ const noun = this . random . arrayElement ( this . locale . company . noun ?? [ "solution" ] )
4444 return `${ adjective } ${ descriptor } ${ noun } `
4545 }
4646
@@ -49,7 +49,7 @@ export class CompanyModule {
4949 * @example faker.company.buzzword() // 'synergize'
5050 */
5151 buzzword ( ) : string {
52- return this . random . arrayElement ( this . locale . company . buzzwords )
52+ return this . random . arrayElement ( this . locale . company . buzzwords ?? [ "innovation" ] )
5353 }
5454
5555 /**
@@ -58,8 +58,8 @@ export class CompanyModule {
5858 */
5959 bs ( ) : string {
6060 const buzzword = this . buzzword ( )
61- const descriptor = this . random . arrayElement ( this . locale . company . descriptor )
62- const noun = this . random . arrayElement ( this . locale . company . noun )
61+ const descriptor = this . random . arrayElement ( this . locale . company . descriptor ?? [ "digital" ] )
62+ const noun = this . random . arrayElement ( this . locale . company . noun ?? [ "solution" ] )
6363 return `${ buzzword } ${ descriptor } ${ noun } `
6464 }
6565}
0 commit comments