Skip to content

Commit

Permalink
Merge pull request #195 from jdanyow/target
Browse files Browse the repository at this point in the history
Return void from target decorators
  • Loading branch information
koddsson committed Apr 4, 2022
2 parents d5b55c2 + 1ace407 commit a8fb3ba
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 a8fb3ba

Please sign in to comment.