|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
897 bytes
|
| Line | |
|---|
| 1 | var mdnProperties = require('mdn-data/css/properties.json');
|
|---|
| 2 | var mdnSyntaxes = require('mdn-data/css/syntaxes.json');
|
|---|
| 3 | var patch = require('./patch.json');
|
|---|
| 4 |
|
|---|
| 5 | function buildDictionary(dict, patchDict) {
|
|---|
| 6 | var result = {};
|
|---|
| 7 |
|
|---|
| 8 | // copy all syntaxes for an original dict
|
|---|
| 9 | for (var key in dict) {
|
|---|
| 10 | result[key] = dict[key].syntax;
|
|---|
| 11 | }
|
|---|
| 12 |
|
|---|
| 13 | // apply a patch
|
|---|
| 14 | for (var key in patchDict) {
|
|---|
| 15 | if (key in dict) {
|
|---|
| 16 | if (patchDict[key].syntax) {
|
|---|
| 17 | result[key] = patchDict[key].syntax;
|
|---|
| 18 | } else {
|
|---|
| 19 | delete result[key];
|
|---|
| 20 | }
|
|---|
| 21 | } else {
|
|---|
| 22 | if (patchDict[key].syntax) {
|
|---|
| 23 | result[key] = patchDict[key].syntax;
|
|---|
| 24 | }
|
|---|
| 25 | }
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | return result;
|
|---|
| 29 | }
|
|---|
| 30 |
|
|---|
| 31 | module.exports = {
|
|---|
| 32 | properties: buildDictionary(mdnProperties, patch.properties),
|
|---|
| 33 | types: buildDictionary(mdnSyntaxes, patch.syntaxes)
|
|---|
| 34 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.