Skip to content

Commit

Permalink
Return void from target decorators
Browse files Browse the repository at this point in the history
Fixes #194
  • Loading branch information
jdanyow committed Apr 4, 2022
1 parent d5b55c2 commit 1ace407
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/target.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {findTarget, findTargets} from './findtarget.js'
* property field. In other words, `@target foo` becomes a getter for
* `findTarget(this, 'foo')`.
*/
export function target<K extends string>(proto: Record<K, unknown>, key: K) {
return Object.defineProperty(proto, key, {
export function target<K extends string>(proto: Record<K, unknown>, key: K): void {
Object.defineProperty(proto, key, {
configurable: true,
get() {
return findTarget(this, key)
Expand All @@ -23,8 +23,8 @@ export function target<K extends string>(proto: Record<K, unknown>, key: K) {
* property field. In other words, `@targets foo` becomes a getter for
* `findTargets(this, 'foo')`.
*/
export function targets<K extends string>(proto: Record<K, unknown>, key: K) {
return Object.defineProperty(proto, key, {
export function targets<K extends string>(proto: Record<K, unknown>, key: K): void {
Object.defineProperty(proto, key, {
configurable: true,
get() {
return findTargets(this, key)
Expand Down

0 comments on commit 1ace407

Please sign in to comment.