1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-04-22 10:52:10 +00:00

perf: Remove Uneeded logging (#219)

This commit is contained in:
Florian Bouillon 2021-12-31 00:40:04 +01:00 committed by GitHub
parent 16467d4a19
commit 1d8077d8b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 13 deletions

View File

@ -80,10 +80,8 @@ export default class Card implements LocalCard {
const res = (require(`../../../generated/${lang}/cards.json`) as Array<SDKCard>).find((c) => {
return objectLoop(params, (it, key) => {
if (key === 'set' && typeof it === 'string') {
console.log("set", c['set'].id, it, lightCheck(c['set'].id, it))
return (c['set'].id === it || lightCheck(c['set'].name, it))
}
console.log("other field", key, c[key as 'localId'], it, lightCheck(c[key as 'localId'], it))
return lightCheck(c[key as 'localId'], it)
})
})

View File

@ -44,17 +44,16 @@ export function betterSorter(a: string, b: string) {
return a >= b ? 1 : -1
}
export function tree(path: string, padding = 0) {
const folder = fs.readdirSync(path)
for (const file of folder) {
const filePath = path + '/' + file
console.log(filePath.padStart(padding, '-'))
try {
fs.lstatSync(filePath).isDirectory()
tree(filePath)
} catch {}
}
}
// export function tree(path: string, padding = 0) {
// const folder = fs.readdirSync(path)
// for (const file of folder) {
// const filePath = path + '/' + file
// try {
// fs.lstatSync(filePath).isDirectory()
// tree(filePath)
// } catch {}
// }
// }
export function lightCheck(source: any, item: any): boolean {
if (typeof source === 'undefined') {