@@ -117,6 +117,7 @@ export class Matrix {
117
117
118
118
matrix ( m : Array < number > ) : Matrix ;
119
119
matrix ( m : ArbitraryMatrix ) : Matrix ;
120
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
120
121
matrix ( m : any ) : Matrix {
121
122
this . cache = null ;
122
123
if ( Array . isArray ( m ) ) {
@@ -179,7 +180,7 @@ export class Matrix {
179
180
return this . cache ;
180
181
}
181
182
182
- var cache = this . v ;
183
+ let cache = this . v ;
183
184
this . queue . forEach (
184
185
( item ) => ( cache = Matrix . combine ( cache , item . matrix6 ( ) ) ) ,
185
186
) ;
@@ -191,8 +192,6 @@ export class Matrix {
191
192
// Apply list of matrixes to (x,y) point.
192
193
// If `isRelative` set, `translate` component of matrix will be skipped
193
194
calc ( point : Point , isRelative ?: boolean ) : Point {
194
- var m ;
195
-
196
195
// Don't change point on empty transforms queue
197
196
if ( ! this . queue . length ) {
198
197
return point ;
@@ -207,7 +206,7 @@ export class Matrix {
207
206
this . cache = this . toArray ( ) ;
208
207
}
209
208
210
- m = this . cache ;
209
+ const m = this . cache ;
211
210
212
211
// Apply matrix to point
213
212
return new Point (
@@ -233,7 +232,7 @@ export class Matrix {
233
232
applyTransformString ( transformString : string ) : Matrix {
234
233
if ( ! transformString ) return this ;
235
234
236
- var operations = {
235
+ const operations = {
237
236
matrix : true ,
238
237
scale : true ,
239
238
rotate : true ,
@@ -246,8 +245,8 @@ export class Matrix {
246
245
/ \s * ( m a t r i x | t r a n s l a t e | s c a l e | r o t a t e | s k e w X | s k e w Y ) \s * \( \s * ( .+ ?) \s * \) [ \s , ] * / ;
247
246
const PARAMS_SPLIT_RE = / [ \s , ] + / ;
248
247
249
- var cmd : string = "" ;
250
- var params : Array < number > ;
248
+ let cmd : string = "" ;
249
+ let params : Array < number > ;
251
250
252
251
// Split value into ['', 'translate', '10 50', '', 'scale', '2', '', 'rotate', '-45', '']
253
252
for ( const item of transformString . split ( CMD_SPLIT_RE ) ) {
@@ -257,7 +256,7 @@ export class Matrix {
257
256
}
258
257
259
258
// remember operation
260
- if ( operations . hasOwnProperty ( item ) ) {
259
+ if ( Object . prototype . hasOwnProperty . call ( operations , item ) ) {
261
260
cmd = item ;
262
261
continue ;
263
262
}
0 commit comments