@@ -191,17 +191,27 @@ export function setProfile(
191191 config : ParticipantProfileExtended ,
192192 setAnonymousProfile = false ,
193193 profileType : ProfileType = ProfileType . ANONYMOUS_ANIMAL ,
194+ informalNameStyle = false ,
194195) {
195196 const randomNumber = Math . floor ( Math . random ( ) * 10000 ) ;
196197
198+ // Format name with random number.
199+ // Informal style: "bear123" (lowercase, no space)
200+ // Default style: "Bear 1002"
201+ const formatName = ( name : string ) => {
202+ if ( informalNameStyle ) {
203+ return `${ name . toLowerCase ( ) } ${ randomNumber } ` ;
204+ }
205+ return `${ name } ${ randomNumber } ` ;
206+ } ;
207+
197208 // Create anonymous profile from a named profile set.
198- // Appends random number to name (e.g., "Bear 1002", "Participant 1002").
199209 const profileFromSet = (
200210 profileSet : { name : string ; avatar : string } [ ] ,
201211 ) : AnonymousProfileMetadata => {
202212 const { name, avatar} = profileSet [ participantNumber % profileSet . length ] ;
203213 return {
204- name : ` ${ name } ${ randomNumber } ` ,
214+ name : formatName ( name ) ,
205215 avatar,
206216 repeat : Math . floor ( participantNumber / profileSet . length ) ,
207217 } ;
0 commit comments