3 ms·
Destructured object parameters make this easy in TypeScript (and JS): async function copyFile({ source, dest, }: {source:string, dest:string}): Pro
by salmonellaeater 7y ago
Destructured object parameters make this easy in TypeScript (and JS):
async function copyFile({
source,
dest,
}: {source:string, dest:string}): Promise<void> {
// ...
}
await copyFile({source: 'presentation.md', dest: '/tmp/backup'});
- yawaramin 7y agoThere's no need to destructure the parameters.