File tree Expand file tree Collapse file tree 1 file changed +1
-14
lines changed
packages/eslint-plugin-svelte/src/rules Expand file tree Collapse file tree 1 file changed +1
-14
lines changed Original file line number Diff line number Diff line change @@ -275,18 +275,5 @@ function couldBeType(
275
275
* Compares two arrays for item equality
276
276
*/
277
277
function arrayEquals ( array1 : AST . SvelteHTMLElement [ ] , array2 : AST . SvelteHTMLElement [ ] ) : boolean {
278
- function comparator ( a : AST . SvelteHTMLElement , b : AST . SvelteHTMLElement ) : number {
279
- return a . range [ 0 ] - b . range [ 0 ] ;
280
- }
281
-
282
- const array2Sorted = array2 . slice ( ) . sort ( comparator ) ;
283
- return (
284
- array1 . length === array2 . length &&
285
- array1
286
- . slice ( )
287
- . sort ( comparator )
288
- . every ( function ( value , index ) {
289
- return value === array2Sorted [ index ] ;
290
- } )
291
- ) ;
278
+ return array1 . length === array2 . length && array1 . every ( ( e ) => array2 . includes ( e ) ) ;
292
279
}
You can’t perform that action at this time.
0 commit comments