Skip to content

Commit 6930d5d

Browse files
fix: ensure arguments are reversed only if not already in correct order
1 parent a4f474a commit 6930d5d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

transforms/v4-deprecated-signatures.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@ export default function transformer(file: FileInfo, _api: API): string {
124124
},
125125
})
126126
.map((path) => {
127-
if (path.value.arguments.length === 2) {
128-
path.value.arguments.reverse()
127+
const args = path.value.arguments;
128+
129+
// if its already in the correct order, dont reverse
130+
if (args.length === 2 && typeof args[0].type !== 'number') {
131+
args.reverse();
129132
}
130133

131134
return path

0 commit comments

Comments
 (0)