Typically, one can access function information by using the following method:
function someFunction(arg1, { a, b, c}){}
someFunction.toString()
... compile and run
//function someFunction(arg1, { a, b, c}){}
However, when TypeScript compiles the code, any function that contains deconstructed arguments will be replaced with _a:
function someOtherFunction(arg1, { a, b, c}){}
console.log(someOtherFunction.toString())
... compile and run
//function someOtherFunction(arg1, _a){}
Is there a way to retrieve the original deconstructed argument information while still utilizing TypeScript?
I've searched through the TS issue tracker, but couldn't find a straightforward solution. Nothing stood out upon initial search.
EDIT As I was attempting this with ts-node, the fix was adjusting both the target and module as described here: https://github.com/TypeStrong/ts-node/issues/678. This ensures that the compiled code remains es6 code which preserves the deconstruction!
Thank you all!