Bug Report
Common object deconstruction code:
interface ISomeObj {
prop1: string;
prop2: string;
}
const clone = (
{ prop1, prop2 }: ISomeObj,
): ISomeObj => ({ prop1, prop2 });
but babel/parser@7.12.1:
/repl.ts: Unexpected token (8:0)
6 | const clone = (
7 | { prop1, prop2 }: ISomeObj,
> 8 | ): ISomeObj => ({ prop1, prop2 });
| ^
9 |
You can try it in babel website Try It Out.
And,
There is no error if param has only one prop:
interface ISomeObj {
prop1: string;
prop2: string;
}
const clone = (
{ prop1 }: ISomeObj,
): ISomeObj => ({ prop1 });
This bug blocks my development, please fix it ASAP.