@pkmn/dex 0.5.10 → 0.5.13
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 +3 -0
- package/build/data/formats-data.json +33 -33
- package/build/data/learnsets.json +11 -4
- 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/learnsets.min.js +1 -1
- package/build/production.min.js +1 -1
- package/index.ts +6 -1
- package/package.json +2 -2
package/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-this-alias */
|
|
1
2
|
import * as T from '@pkmn/dex-types';
|
|
2
3
|
|
|
3
4
|
import * as AbilitiesJSON from './data/abilities.json';
|
|
@@ -93,13 +94,17 @@ class DexConditions implements T.DexTable<Condition> {
|
|
|
93
94
|
|
|
94
95
|
get(name: string): Condition {
|
|
95
96
|
// 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
|
|
97
|
+
// for loose compatibility with Pokémon Showdown's Dex API. 'move:id' also needs to be handled
|
|
98
|
+
// for the client to work correctly.
|
|
97
99
|
if (name.startsWith('item:')) {
|
|
98
100
|
const item = this.dex.items.get(name.slice(5));
|
|
99
101
|
return item as any as Condition;
|
|
100
102
|
} else if (name.startsWith('ability:')) {
|
|
101
103
|
const ability = this.dex.abilities.get(name.slice(8));
|
|
102
104
|
return ability as any as Condition;
|
|
105
|
+
} else if (name.startsWith('move:')) {
|
|
106
|
+
const move = this.dex.moves.get(name.slice(5));
|
|
107
|
+
return move as any as Condition;
|
|
103
108
|
}
|
|
104
109
|
return this.getByID(toID(name));
|
|
105
110
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pkmn/dex",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
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.13"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"lint": "eslint --cache *.ts",
|