Improve fusion names with a space present

This commit is contained in:
Flashfyre 2024-04-07 00:28:37 -04:00
parent 39667f3398
commit fae5b642f6
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ export function getFusedSpeciesName(speciesAName: string, speciesBName: string):
const fragAPattern = /([a-z]{2}.*?[aeiou(?:y$)\-\']+)(.*?)$/i;
const fragBPattern = /([a-z]{2}.*?[aeiou(?:y$)\-\'])(.*?)$/i;
const [ speciesAPrefixMatch, speciesBPrefixMatch ] = [ speciesAName, speciesBName ].map(n => /^(?:Mega|(?:G|E)\-Max) /.exec(n));
const [ speciesAPrefixMatch, speciesBPrefixMatch ] = [ speciesAName, speciesBName ].map(n => /^(?:[^ ]+) /.exec(n));
const [ speciesAPrefix, speciesBPrefix ] = [ speciesAPrefixMatch, speciesBPrefixMatch ].map(m => m ? m[0] : '');
if (speciesAPrefix)
@ -47,7 +47,7 @@ export function getFusedSpeciesName(speciesAName: string, speciesBName: string):
if (speciesBPrefix)
speciesBName = speciesBName.slice(speciesBPrefix.length);
const [ speciesASuffixMatch, speciesBSuffixMatch ] = [ speciesAName, speciesBName ].map(n => / (?:X|Y)$/.exec(n));
const [ speciesASuffixMatch, speciesBSuffixMatch ] = [ speciesAName, speciesBName ].map(n => / (?:[^ ]+)$/.exec(n));
const [ speciesASuffix, speciesBSuffix ] = [ speciesASuffixMatch, speciesBSuffixMatch ].map(m => m ? m[0] : '');
if (speciesASuffix)