Skip to content

Commit

Permalink
Merge pull request #34 from nikolai-shabalin/feature/rename
Browse files Browse the repository at this point in the history
Replaces complex viewport_percentage_units_dynamic with “`dvb`, `dvh`…
  • Loading branch information
nikolai-shabalin authored Dec 19, 2024
2 parents 8b175aa + 6fa2f03 commit f299f28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/data/createData.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,18 @@ const extractData = (properties, parent = null) => {
if (!date) continue;

const year = date.split("-")[0];

const name = propertyName.includes('_') && compat.description
? compat.description.replace(/<\/?code>|&lt;|&gt;/g, '')
: propertyName;

const entry = {
name: propertyName,
name,
date,
type: parent ? "Значение" : "Свойство",
parent: parent || null,
mdnUrl: compat.mdn_url || null,
specUrl: compat.spec_url || null,
year: date.split('-')[0]
specUrl: compat.spec_url || null
};

if (!groupedData[year]) {
Expand All @@ -73,4 +77,4 @@ for (const year in groupedData) {
groupedData[year].sort((a, b) => b.date.localeCompare(a.date));
}

fs.writeFileSync('./data.js', `export const data = ${JSON.stringify(groupedData)};`);
fs.writeFileSync('./src/data/data.js', `export const data = ${JSON.stringify(groupedData)};`);
2 changes: 1 addition & 1 deletion src/data/data.js

Large diffs are not rendered by default.

0 comments on commit f299f28

Please sign in to comment.