mirror of
https://github.com/tcgdex/cards-database.git
synced 2025-07-29 03:09:49 +00:00
Update interfaces
Signed-off-by: Avior <florian.bouillon@delta-wings.net>
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
import { Page } from "puppeteer-core";
|
||||
|
||||
enum Tag {
|
||||
BASIC,
|
||||
BASICENERGY,
|
||||
@ -78,20 +76,6 @@ namespace Tag {
|
||||
break;
|
||||
}
|
||||
}
|
||||
export async function get(tab: Page): Promise<Array<Tag>> {
|
||||
const h2 = await tab.$eval(".card-type h2", (el: HTMLElement) => {
|
||||
return el.innerText
|
||||
})
|
||||
const list: Array<Tag> = lookup(h2)
|
||||
|
||||
// SP
|
||||
const isNull = await tab.$('h1 img[alt="[G]"]')
|
||||
if (isNull !== null) {
|
||||
list.push(Tag.SP)
|
||||
}
|
||||
|
||||
return list
|
||||
}
|
||||
|
||||
export function lookup(str: string): Array<Tag> {
|
||||
const list: Array<Tag> = []
|
||||
|
Reference in New Issue
Block a user