diff --git a/src/routes/legacy-ids.js b/src/routes/legacy-ids.js index 3d4dcfd..318503d 100644 --- a/src/routes/legacy-ids.js +++ b/src/routes/legacy-ids.js @@ -6,6 +6,7 @@ module.exports = { handler: () => { // Get legacy IDs and sort const map = Object.entries(legacy) + .filter((k) => k[0] !== '$schema') .sort((a, b) => a[0].localeCompare(b[0]) ? -1 : 1) .reduce((obj, [key, value]) => ({ ...obj, [key]: value }), {}); diff --git a/src/util/getList.js b/src/util/getList.js index 32e5690..f64551c 100644 --- a/src/util/getList.js +++ b/src/util/getList.js @@ -9,14 +9,23 @@ module.exports = id => { const list = { ...match }; // Load full features - list.features = featuresData.map(feature => ({ - ...feature, - value: list.features.includes(feature.id) ? 1 : 0, - })).sort((a, b) => { + list.features = featuresData.map(feature => { + const withValue = { + ...feature, + value: list.features.includes(feature.id) ? 1 : 0, + }; + + delete withValue['$schema']; + + return withValue; + }).sort((a, b) => { if (a.value !== b.value) return a.value ? -1 : 1; if (a.display !== b.display) return a.display > b.display ? -1 : 1; return a.name.localeCompare(b.name) ? -1 : 1; }); + // Drop $schema + delete list['$schema']; + return list; };