Given this function
function Func(token: string, deps: string[], resolveFn: (...args: any[]) => any) {
// Stuff
}
My goal is for the resolveFn
's arguments to match the dependencies.
Example this would be valid:
Func('test', ['arg1', 'arg2'], (arg1: any, arg2: any) => {})
This would not be valid:
Func('test', ['arg1', 'arg2'], (hello: any, world: any) => {})
This one is maybe more difficult but should also not be valid:
Func('test', ['arg1', 'arg2'], (arg2: any, arg1: any) => {})
Is this feasable?
Thank you