Skip to content

Commit 4f4f2c6

Browse files
authored
Return object on decorators
This makes the decorators compatible with Babel's Typescript converter.
1 parent 6bfccdf commit 4f4f2c6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/target.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {findTarget, findTargets} from './findtarget'
88
* `findTarget(this, 'foo')`.
99
*/
1010
export function target<K extends string>(proto: Record<K, unknown>, key: K): void {
11-
Object.defineProperty(proto, key, {
11+
return Object.defineProperty(proto, key, {
1212
configurable: true,
1313
get() {
1414
return findTarget(this, key)
@@ -24,7 +24,7 @@ export function target<K extends string>(proto: Record<K, unknown>, key: K): voi
2424
* `findTargets(this, 'foo')`.
2525
*/
2626
export function targets<K extends string>(proto: Record<K, unknown>, key: K): void {
27-
Object.defineProperty(proto, key, {
27+
return Object.defineProperty(proto, key, {
2828
configurable: true,
2929
get() {
3030
return findTargets(this, key)

0 commit comments

Comments
 (0)