Skip to content

Commit

Permalink
Replaces complex viewport_percentage_units_dynamic with “dvb, dvh
Browse files Browse the repository at this point in the history
…, `dvi`, `dvmax`, `dvmin`, `dvw` units”
  • Loading branch information
nikolai-shabalin committed Dec 19, 2024
1 parent 8b175aa commit 6fa2f03
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 6fa2f03

Please sign in to comment.