Typescript infers that if you touch the arguments value inside a function that it has extra arguments as ...args: any[]
However if you call a method with an object and one of the fields is called arguments: [] then it thinks you are using the arguments variable inside of the function, then it adds ...args: any[]

https://www.typescriptlang.org/play?filetype=js#code/LAKAxg9gdgzgLgAhgT3gUwLYILwIN5JpQAmAFBAJT4C+C1ooAZhBAEYCGATqQOTRo8KAbgYgA9ACoJoBBIQABAA5d2WPPE4BLKAHNa-GRLFMArlDBxN0BMzZcE5KGip4ZSVHEwA6GETKuQBCCEdkVNAC4EHlsOTh4AGjcgrh0TDCI4GEiAbR4ACzQAG0KIHgBdN2oKUGogA
const system = { send(o) {} }
foobar('one');
/**
* @param {string} one
*/
function foobar (one) {
system.send({
api: 'foobar',
arguments: ['hello']
})
}
Typescript infers that if you touch the
argumentsvalue inside a function that it has extra arguments as...args: any[]However if you call a method with an object and one of the fields is called
arguments: []then it thinks you are using theargumentsvariable inside of the function, then it adds...args: any[]https://www.typescriptlang.org/play?filetype=js#code/LAKAxg9gdgzgLgAhgT3gUwLYILwIN5JpQAmAFBAJT4C+C1ooAZhBAEYCGATqQOTRo8KAbgYgA9ACoJoBBIQABAA5d2WPPE4BLKAHNa-GRLFMArlDBxN0BMzZcE5KGip4ZSVHEwA6GETKuQBCCEdkVNAC4EHlsOTh4AGjcgrh0TDCI4GEiAbR4ACzQAG0KIHgBdN2oKUGogA