File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ exports.JSON = async function(cssText) {
240240
241241 if ( / ^ [ . # a - z A - Z 0 - 9 \- \s , : ( ) % * \+ < > _ \[ \] = " ] + $ / . test ( selectorText ) ) {
242242 const selectors = selectorText . split ( ',' ) . map ( s => s . trim ( ) ) ;
243- const properties = { } ;
243+ let properties = [ ] ;
244244 const nestedRules = [ ] ;
245245
246246 while ( index < length ) {
@@ -270,7 +270,7 @@ exports.JSON = async function(cssText) {
270270
271271 if ( line . includes ( ':' ) ) {
272272 const [ key , value ] = line . split ( ':' ) . map ( s => s . trim ( ) ) ;
273- properties [ key ] = value ;
273+ properties . push ( [ key , value ] ) ;
274274 if ( cleanedCSS [ index ] === ';' ) index ++ ;
275275 } else if ( cleanedCSS [ index ] === '}' ) {
276276 index ++ ;
Original file line number Diff line number Diff line change @@ -44,9 +44,9 @@ async function serializeRules(rules) {
4444 return `${ rule . name } {${ innerContent } }` ;
4545 } else if ( rule . type === 'rule' ) {
4646 const props = [ ] ;
47- for ( const [ key , value ] of Object . entries ( rule . properties ) ) {
47+ rule . properties . forEach ( ( [ key , value ] ) => {
4848 props . push ( `${ key } :${ value } ` ) ;
49- }
49+ } ) ;
5050 return `${ rule . selectors . join ( ',' ) } {${ props . join ( ';' ) } }` ;
5151 } else if ( rule . type === 'insert' ) {
5252 return rule . text ;
Original file line number Diff line number Diff line change @@ -328,9 +328,9 @@ async function lhl() {
328328 const lighthighlight = await _just . parseCSS . JSON ( JSON . parse ( HIGHLIGHTJSON ) [ "_just_light" ] ) ;
329329 lighthighlight . forEach ( rule => {
330330 const props = [ ] ;
331- for ( const [ keyy , valme ] of Object . entries ( rule . properties ) ) {
331+ rule . properties . forEach ( ( [ keyy , valme ] ) => {
332332 props . push ( `${ keyy } :${ valme } ` ) ;
333- }
333+ } ) ;
334334 const outstr = ( addclass ) => `${ rule . selectors . map ( s => `.${ addclass } ${ s } ` ) . join ( ',' ) } {${ props . join ( ';' ) } }` ;
335335 CSSHIGHLIGHT += outstr ( cssclass . l ) ;
336336 CSSHIGHLIGHT += `@media (prefers-color-scheme: light) {${ outstr ( cssclass . a ) } }` ;
You can’t perform that action at this time.
0 commit comments