leonardfactory / babel-plugin-transform-typescript-metadata

Babel plugin to emit decorator metadata like typescript compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

design:paramtypes does not work with object assignment

jeffborg opened this issue · comments

Been using type-graphql and came across this issue

Here is a sample class which returns a void type for the argument

class Demo {
  @Method()
  test(@Args(): { destructedProp } : ClassType) {}
}

This sample works

class Demo {
  @Method()
  test(@Args(): arg : ClassType) {}
}

It seems the param.type here https://github.com/leonardfactory/babel-plugin-transform-typescript-metadata/blob/master/src/metadata/serializeType.ts#L25 is ObjectPattern and this results in returning voidZero()

Thank you @jeffborg ! Released it in v0.3.2 👍🏼