aboutsummaryrefslogtreecommitdiff
path: root/dev/generate-css-json.js
diff options
context:
space:
mode:
Diffstat (limited to 'dev/generate-css-json.js')
-rw-r--r--dev/generate-css-json.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/dev/generate-css-json.js b/dev/generate-css-json.js
index 26bdfa64..a837c9e2 100644
--- a/dev/generate-css-json.js
+++ b/dev/generate-css-json.js
@@ -101,11 +101,11 @@ export function formatRulesJson(rules) {
for (const {selectors, styles} of rules) {
if (ruleIndex > 0) { result += ','; }
result += `\n${indent1}{\n${indent2}"selectors": `;
- if (selectors.length === 1) {
- result += `[${JSON.stringify(selectors[0], null, 4)}]`;
- } else {
- result += JSON.stringify(selectors, null, 4).replace(/\n/g, '\n' + indent2);
- }
+ result += (
+ selectors.length === 1 ?
+ `[${JSON.stringify(selectors[0], null, 4)}]` :
+ JSON.stringify(selectors, null, 4).replace(/\n/g, '\n' + indent2)
+ );
result += `,\n${indent2}"styles": [`;
let styleIndex = 0;
for (const [key, value] of styles) {