Skip to content

Commit 32646a4

Browse files
authored
Merge pull request #13 from Mygod/patch-1
Fix #12
2 parents 190e1ef + 70b3156 commit 32646a4

File tree

1 file changed

+16
-22
lines changed

1 file changed

+16
-22
lines changed

src/uicons.ts

+16-22
Original file line numberDiff line numberDiff line change
@@ -395,38 +395,32 @@ export class UICONS<Index extends UiconsIndex = UiconsIndex> {
395395

396396
const baseUrl = `${this.#path}/pokemon`
397397

398+
const breadSuffixes = bread ? [`_b${bread}`, ''] : ['']
398399
const evolutionSuffixes = evolution ? [`_e${evolution}`, ''] : ['']
399400
const formSuffixes = form ? [`_f${form}`, ''] : ['']
400401
const costumeSuffixes = costume ? [`_c${costume}`, ''] : ['']
401402
const genderSuffixes = gender ? [`_g${gender}`, ''] : ['']
402403
const alignmentSuffixes = alignment ? [`_a${alignment}`, ''] : ['']
403-
const breadSuffixes = bread ? [`_b${bread}`, ''] : ['']
404404
const shinySuffixes = shiny ? ['_s', ''] : ['']
405405

406+
for (let b = 0; b < breadSuffixes.length; b += 1) {
406407
for (let e = 0; e < evolutionSuffixes.length; e += 1) {
407-
for (let f = 0; f < formSuffixes.length; f += 1) {
408-
for (let c = 0; c < costumeSuffixes.length; c += 1) {
409-
for (let g = 0; g < genderSuffixes.length; g += 1) {
410-
for (let a = 0; a < alignmentSuffixes.length; a += 1) {
411-
for (let b = 0; b < breadSuffixes.length; b += 1) {
412-
for (let s = 0; s < shinySuffixes.length; s += 1) {
413-
const result = `${pokemonId}${evolutionSuffixes[e]}${
414-
formSuffixes[f]
415-
}${costumeSuffixes[c]}${genderSuffixes[g]}${
416-
alignmentSuffixes[a]
417-
}${breadSuffixes[b]}${shinySuffixes[s]}.${
418-
this.#extensionMap.pokemon
419-
}`
420-
if (this.#pokemon.has(result)) {
421-
return `${baseUrl}/${result}`
422-
}
423-
}
424-
}
425-
}
426-
}
427-
}
408+
for (let f = 0; f < formSuffixes.length; f += 1) {
409+
for (let c = 0; c < costumeSuffixes.length; c += 1) {
410+
for (let g = 0; g < genderSuffixes.length; g += 1) {
411+
for (let a = 0; a < alignmentSuffixes.length; a += 1) {
412+
for (let s = 0; s < shinySuffixes.length; s += 1) {
413+
const result = `${pokemonId}${breadSuffixes[b]}${evolutionSuffixes[e]}${formSuffixes[f]}${costumeSuffixes[c]}${genderSuffixes[g]}${alignmentSuffixes[a]}${shinySuffixes[s]}.${this.#extensionMap.pokemon}`
414+
if (this.#pokemon.has(result)) {
415+
return `${baseUrl}/${result}`
428416
}
429417
}
418+
}
419+
}
420+
}
421+
}
422+
}
423+
}
430424
return `${baseUrl}/0.${this.#extensionMap.pokemon}`
431425
}
432426

0 commit comments

Comments
 (0)