@@ -23,10 +23,10 @@ function isSourceMapAnnotation(rule) {
23
23
function parseQueryList ( queryList ) {
24
24
const queries = [ ] ;
25
25
26
- list . comma ( queryList ) . forEach ( function ( query ) {
26
+ list . comma ( queryList ) . forEach ( ( query ) => {
27
27
const expressions = { } ;
28
28
29
- list . space ( query ) . forEach ( function ( expression ) {
29
+ list . space ( query ) . forEach ( ( expression ) => {
30
30
expression = expression . toLowerCase ( ) ;
31
31
32
32
if ( expression === "and" ) {
@@ -94,19 +94,19 @@ function inspectLength(length) {
94
94
function pickMinimumMinWidth ( expressions ) {
95
95
const minWidths = [ ] ;
96
96
97
- expressions . forEach ( function ( feature ) {
97
+ expressions . forEach ( ( feature ) => {
98
98
let minWidth = feature [ "min-width" ] ;
99
99
100
100
if ( ! minWidth || feature . not || feature . print ) {
101
101
minWidth = [ null ] ;
102
102
}
103
103
104
- minWidths . push ( minWidth . map ( inspectLength ) . sort ( function ( a , b ) {
104
+ minWidths . push ( minWidth . map ( inspectLength ) . sort ( ( a , b ) => {
105
105
return b - a ;
106
106
} ) [ 0 ] ) ;
107
107
} ) ;
108
108
109
- return minWidths . sort ( function ( a , b ) {
109
+ return minWidths . sort ( ( a , b ) => {
110
110
return a - b ;
111
111
} ) [ 0 ] ;
112
112
}
@@ -122,25 +122,25 @@ function sortQueryLists(queryLists, sort) {
122
122
return queryLists . sort ( sort ) ;
123
123
}
124
124
125
- queryLists . forEach ( function ( queryList ) {
125
+ queryLists . forEach ( ( queryList ) => {
126
126
mapQueryLists . push ( parseQueryList ( queryList ) ) ;
127
127
} ) ;
128
128
129
- return mapQueryLists . map ( function ( e , i ) {
129
+ return mapQueryLists . map ( ( e , i ) => {
130
130
return {
131
131
index : i ,
132
132
value : pickMinimumMinWidth ( e )
133
133
} ;
134
134
} )
135
- . sort ( function ( a , b ) {
135
+ . sort ( ( a , b ) => {
136
136
return a . value - b . value ;
137
137
} )
138
- . map ( function ( e ) {
138
+ . map ( ( e ) => {
139
139
return queryLists [ e . index ] ;
140
140
} ) ;
141
141
}
142
142
143
- module . exports = postcss . plugin ( pkg . name , function ( opts ) {
143
+ module . exports = postcss . plugin ( pkg . name , ( opts ) => {
144
144
if ( ! opts ) {
145
145
opts = { } ;
146
146
}
@@ -159,12 +159,12 @@ module.exports = postcss.plugin(pkg.name, function (opts) {
159
159
sourceMap = null ;
160
160
}
161
161
162
- css . walkAtRules ( "media" , function ( atRule ) {
162
+ css . walkAtRules ( "media" , ( atRule ) => {
163
163
const queryList = atRule . params ;
164
164
const past = queries [ queryList ] ;
165
165
166
166
if ( typeof past === "object" ) {
167
- atRule . each ( function ( rule ) {
167
+ atRule . each ( ( rule ) => {
168
168
past . append ( rule . clone ( ) ) ;
169
169
} ) ;
170
170
} else {
@@ -175,7 +175,7 @@ module.exports = postcss.plugin(pkg.name, function (opts) {
175
175
atRule . remove ( ) ;
176
176
} ) ;
177
177
178
- sortQueryLists ( queryLists , opts . sort ) . forEach ( function ( queryList ) {
178
+ sortQueryLists ( queryLists , opts . sort ) . forEach ( ( queryList ) => {
179
179
css . append ( queries [ queryList ] ) ;
180
180
} ) ;
181
181
0 commit comments