From b46c51c9f0f50e91c78160e6aa5c96a9ead72e57 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sat, 2 Oct 2021 01:08:23 +0200 Subject: [PATCH] chore: remove empty entries from flags in compendium packs --- gulpfile.js | 5 +++++ src/packs/creatures.json | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 9682be33..36889fb9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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 = [ diff --git a/src/packs/creatures.json b/src/packs/creatures.json index 7c19c11b..3b01f2ff 100644 --- a/src/packs/creatures.json +++ b/src/packs/creatures.json @@ -5477,9 +5477,7 @@ "permission": { "default": 0 }, - "flags": { - "core": {} - } + "flags": {} }, { "_id": "CIzMY691MK016h4E",