Skip to content

Commit 69066ba

Browse files
committed
support discarding tags, not just keys
1 parent 17e6bac commit 69066ba

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

lib/build.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -620,14 +620,20 @@ function generateTaginfo(presets, fields, deprecated, discarded, tstrings, proje
620620
});
621621

622622
if (!discarded) discarded = {};
623-
Object.keys(discarded).forEach(key => {
623+
for (const key in discarded) {
624624
let description = '🄳🄳 (discarded tag)';
625-
let tag = {
626-
key,
627-
description: [description]
628-
};
629-
coalesceTags(taginfo, tag);
630-
});
625+
if (discarded[key] === true) {
626+
// key=*
627+
let tag = { key, description: [description] };
628+
coalesceTags(taginfo, tag);
629+
} else {
630+
// key=value
631+
for (const value in discarded[key]) {
632+
const tag = { key, value, description: [description] };
633+
coalesceTags(taginfo, tag);
634+
}
635+
}
636+
}
631637

632638
taginfo.tags.forEach(elem => {
633639
if (elem.description) {

schemas/discarded.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"$schema": "http://json-schema.org/draft-07/schema#",
33
"$id": "https://github.com/ideditor/schema-builder/raw/main/schemas/discarded.json",
44
"title": "Discarded tags",
5-
"description": "Keys of tags to be deleted when editing features.",
5+
"description": "Keys or tags to be deleted when editing features.",
66
"type": "object",
77
"additionalProperties": {
8-
"type": "boolean"
8+
"anyOf": [
9+
{ "type": "boolean", "enum": [true] },
10+
{ "type": "object", "additionalProperties": { "type": "boolean", "enum": [true] } }
11+
]
912
}
1013
}

0 commit comments

Comments
 (0)