Commit 9f838a29 authored by nanahira's avatar nanahira

add custom field option

parent 885327ee
Pipeline #24059 passed with stages
in 2 minutes and 44 seconds
......@@ -247,6 +247,15 @@ function formatCard(data: YGOProCardLike): YGOProCard {
'https://cdn02.moecube.com:444/images/ygopro-images-zh-CN/') +
data.id.toString() +
(process.env.YGOPRO_PIC_URL_SUFFIX || '.jpg');
if (process.env.FIELDS) {
const fields = new Set(process.env.FIELDS.split(','));
// keep only the fields specified
for (const key of Object.keys(result)) {
if (!fields.has(key)) {
delete result[key];
}
}
}
return result as YGOProCard;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment