March 15, 2020
Defining a wrapper function with the same parameters as the inner function.
import { spawn } from 'child_process';
function customSpawn(...options: Parameters<typeof spawn>) {
console.log('some custom code');
return spawn(...options);
}
References:
- https://stackoverflow.com/questions/51851677/how-to-get-argument-types-from-function-in-typescript/51851844#answer-51851844
typescript
Previous post
Debugging web applications in vscode
Next post
Don’t attach tooltips to document.body