@pkmn/dex 0.5.11 → 0.5.12
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/build/data/aliases.json +2 -0
- package/build/data/formats-data.json +32 -32
- package/build/data/moves.json +0 -2
- package/build/data/species.json +2 -2
- package/build/index.js +6 -1
- package/build/index.js.map +1 -1
- package/build/production.min.js +1 -1
- package/index.ts +5 -1
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -93,13 +93,17 @@ class DexConditions implements T.DexTable<Condition> {
|
|
|
93
93
|
|
|
94
94
|
get(name: string): Condition {
|
|
95
95
|
// This treatment of 'item:id' and 'ability:id' is kind of repugnant but regrettably exists
|
|
96
|
-
// for loose compatibility with Pokémon Showdown's Dex API
|
|
96
|
+
// for loose compatibility with Pokémon Showdown's Dex API. 'move:id' also needs to be handled
|
|
97
|
+
// for the client to work correctly.
|
|
97
98
|
if (name.startsWith('item:')) {
|
|
98
99
|
const item = this.dex.items.get(name.slice(5));
|
|
99
100
|
return item as any as Condition;
|
|
100
101
|
} else if (name.startsWith('ability:')) {
|
|
101
102
|
const ability = this.dex.abilities.get(name.slice(8));
|
|
102
103
|
return ability as any as Condition;
|
|
104
|
+
} else if (name.startsWith('move:')) {
|
|
105
|
+
const move = this.dex.moves.get(name.slice(5));
|
|
106
|
+
return move as any as Condition;
|
|
103
107
|
}
|
|
104
108
|
return this.getByID(toID(name));
|
|
105
109
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pkmn/dex",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.12",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"unpkg": "build/production.min.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"index.ts"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@pkmn/dex-types": "^0.5.
|
|
19
|
+
"@pkmn/dex-types": "^0.5.12"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"lint": "eslint --cache *.ts",
|