mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Fix
This commit is contained in:
@@ -8,7 +8,8 @@ module.exports = class AbilityStore extends Collection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fetch(query) {
|
async fetch(query) {
|
||||||
query = this.makeSlug(query);
|
if (this.has(query)) return this.get(query);
|
||||||
|
query = this.makeSlug(query.toString());
|
||||||
if (!query) return null;
|
if (!query) return null;
|
||||||
const found = this.find(pokemon => pokemon.slug === query);
|
const found = this.find(pokemon => pokemon.slug === query);
|
||||||
if (found) return found;
|
if (found) return found;
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ module.exports = class MoveStore extends Collection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fetch(query) {
|
async fetch(query) {
|
||||||
query = this.makeSlug(query);
|
if (this.has(query)) return this.get(query);
|
||||||
|
query = this.makeSlug(query.toString());
|
||||||
if (!query) return null;
|
if (!query) return null;
|
||||||
const found = this.find(pokemon => pokemon.slug === query);
|
const found = this.find(pokemon => pokemon.slug === query);
|
||||||
if (found) return found;
|
if (found) return found;
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ module.exports = class PokemonStore extends Collection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fetch(query) {
|
async fetch(query) {
|
||||||
query = this.makeSlug(query);
|
if (this.has(query)) return this.get(query);
|
||||||
|
query = this.makeSlug(query.toString());
|
||||||
if (!query) return null;
|
if (!query) return null;
|
||||||
const num = Number.parseInt(query, 10);
|
const num = Number.parseInt(query, 10);
|
||||||
if (this.has(num)) return this.get(num);
|
if (this.has(num)) return this.get(num);
|
||||||
|
|||||||
Reference in New Issue
Block a user