@pkmn/sim 0.5.23 → 0.5.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/build/config/formats.js +85 -70
- package/build/config/formats.js.map +1 -1
- package/build/data/pokedex.js +1 -1
- package/build/data/rulesets.js +123 -2
- package/build/data/rulesets.js.map +1 -1
- package/build/data/tags.js +1 -1
- package/build/data/tags.js.map +1 -1
- package/build/lib/utils.d.ts +4 -0
- package/build/lib/utils.js +20 -1
- package/build/lib/utils.js.map +1 -1
- package/config/formats.ts +88 -70
- package/data/pokedex.ts +1 -1
- package/data/rulesets.ts +119 -2
- package/data/tags.ts +1 -1
- package/lib/utils.ts +16 -0
- package/package.json +1 -1
package/data/tags.ts
CHANGED
|
@@ -200,7 +200,7 @@ export const Tags: {[id: string]: TagData} = {
|
|
|
200
200
|
'Aerodactyl-Mega', 'Alakazam', 'Blacephalon', 'Blaziken', 'Diancie-Mega', 'Gallade-Mega', 'Gardevoir-Mega', 'Gengar', 'Gyarados',
|
|
201
201
|
'Gyarados-Mega', 'Hawlucha', 'Heracross-Mega', 'Hoopa-Unbound', 'Hydreigon', 'Jirachi', 'Latias', 'Latias-Mega', 'Latios',
|
|
202
202
|
'Latios-Mega', 'Manaphy', 'Medicham-Mega', 'Melmetal', 'Mew', 'Moltres-Galar', 'Pinsir-Mega', 'Sableye-Mega', 'Slowbro-Mega',
|
|
203
|
-
'Slowking-Galar', 'Thundurus', 'Venusaur-Mega', 'Xurkitree', 'Zapdos-Galar',
|
|
203
|
+
'Slowking-Galar', 'Thundurus', 'Thundurus-Therian', 'Venusaur-Mega', 'Xurkitree', 'Zapdos-Galar',
|
|
204
204
|
].includes(species.name),
|
|
205
205
|
},
|
|
206
206
|
|
package/lib/utils.ts
CHANGED
|
@@ -63,6 +63,22 @@ export function stripHTML(htmlContent: string) {
|
|
|
63
63
|
return htmlContent.replace(/<[^>]*>/g, '');
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Maps numbers to their ordinal string.
|
|
68
|
+
*/
|
|
69
|
+
export function formatOrder(place: number) {
|
|
70
|
+
// anything between 10 and 20 should always end with -th
|
|
71
|
+
let remainder = place % 100;
|
|
72
|
+
if (remainder >= 10 && remainder <= 20) return place + 'th';
|
|
73
|
+
|
|
74
|
+
// follow standard rules with -st, -nd, -rd, and -th
|
|
75
|
+
remainder = place % 10;
|
|
76
|
+
if (remainder === 1) return place + 'st';
|
|
77
|
+
if (remainder === 2) return place + 'nd';
|
|
78
|
+
if (remainder === 3) return place + 'rd';
|
|
79
|
+
return place + 'th';
|
|
80
|
+
}
|
|
81
|
+
|
|
66
82
|
/**
|
|
67
83
|
* Visualizes eval output in a slightly more readable form
|
|
68
84
|
*/
|
package/package.json
CHANGED