-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update target name to be a valid typescript 5 decorator
- Loading branch information
1 parent
7619dd4
commit 0bc0f04
Showing
2 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import * as METADATA_KEY from '../constants/metadata_keys'; | ||
import { Metadata } from '../planning/metadata'; | ||
import { tagParameter, DecoratorTarget } from './decorator_utils'; | ||
import * as METADATA_KEY from "../constants/metadata_keys"; | ||
import { Metadata } from "../planning/metadata"; | ||
import { tagParameter, DecoratorTarget } from "./decorator_utils"; | ||
|
||
function targetName(name: string) { | ||
return function (target: DecoratorTarget, targetKey: string, index: number) { | ||
return function ( | ||
target: DecoratorTarget, | ||
targetKey: string | undefined, | ||
index: number | ||
) { | ||
const metadata = new Metadata(METADATA_KEY.NAME_TAG, name); | ||
tagParameter(target, targetKey, index, metadata); | ||
}; | ||
} | ||
|
||
export { targetName }; | ||
export { targetName }; |