toss / nestjs-aop

A way to gracefully apply AOP to nestjs
MIT License
213 stars 24 forks source link

[BUG]: Cannot apply more than one AopDecorator in one method #6

Closed WhiteKiwi closed 1 year ago

WhiteKiwi commented 1 year ago

Describe the bug

Only "@Foo(2)" is decorated in the following situations. Because SetMetadata overwrites the value for the key, more than one cannot be used.

const FOO = Symbol('FOO');
const Foo = (num: number) => SetMetedata(FOO, num)

class SomeService {
  @Foo(1)
  @Foo(2)
  doSomething() { ... }
}

Expected behavior

To Reproduce

Possible Solution

Additional context

jinkyuhan commented 1 year ago

No. Just Foo(1) works only. The metadata detector recognizes the Foo(1) only. Because It's the last one I decorated.

WhiteKiwi commented 1 year ago

It will be resolved in v2.