我想创建一个引擎,将我的自定义变量注入到打字稿中的函数中。
示例:
const TEST = {
foo: 1,
bar: "2",
};
const resolveValue = (name: string) => TEST[name];
function hello(@resolveValue("foo") foo: number, @resolveValue("bar") bar: string) {
console.log(foo);
console.log(bar);
}
这种技术类似于nestjs库。
我应该使用哪些技术或库?
我已经在Google上搜索过,但没有找到解决方案。