1
0
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:
2020-02-08 00:41:23 +01:00
parent f6aa8fc5e8
commit 4190dd8e27
5 changed files with 80 additions and 276 deletions

View File

@ -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> = []