File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/plugin-esm/lib/sort-imports-by-specifiers Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ module.exports.traverse = ({push}) => ({
2929 if ( nextPath . node . specifiers . length !== 1 )
3030 return ;
3131
32- const is = isExcluded ( source , nextPath , {
32+ const first = source . value ;
33+ const second = nextPath . node . source . value ;
34+
35+ const is = isExcluded ( first , second , {
3336 direct : [
3437 [ 'node:' , 'node:' ] ,
3538 [ '#' , '#' ] ,
@@ -50,14 +53,14 @@ module.exports.traverse = ({push}) => ({
5053 } ,
5154} ) ;
5255
53- function isExcluded ( source , nextPath , { direct, reversed} ) {
56+ function isExcluded ( first , second , { direct, reversed} ) {
5457 for ( const [ current , next ] of direct ) {
55- if ( source . value . startsWith ( current ) && ! nextPath . node . source . value . startsWith ( next ) )
58+ if ( first . startsWith ( current ) && ! second . startsWith ( next ) )
5659 return true ;
5760 }
5861
5962 for ( const [ current , next ] of reversed ) {
60- if ( ! source . value . startsWith ( current ) && nextPath . node . source . value . startsWith ( next ) )
63+ if ( ! first . startsWith ( current ) && second . startsWith ( next ) )
6164 return true ;
6265 }
6366
You can’t perform that action at this time.
0 commit comments