chore: remove empty entries from flags in compendium packs

This commit is contained in:
Johannes Loher 2021-10-02 01:08:23 +02:00
parent 41a4685872
commit b46c51c9f0
2 changed files with 6 additions and 3 deletions

View file

@ -58,6 +58,11 @@ function cleanPackEntry(entry, cleanSourceId = true) {
if (cleanSourceId) {
delete entry.flags?.core?.sourceId;
}
Object.keys(entry.flags).forEach((scope) => {
if (Object.keys(entry.flags[scope]).length === 0) {
delete entry.flags[scope];
}
});
if (entry.permission) entry.permission = { default: 0 };
const embeddedDocumentCollections = [

View file

@ -5477,9 +5477,7 @@
"permission": {
"default": 0
},
"flags": {
"core": {}
}
"flags": {}
},
{
"_id": "CIzMY691MK016h4E",