Is there a way to remove one of the elements from a type that is an array? I'm looking to curry something and make the whole thing easier.
E.g.
function NEW_PERSON (name : string, age : number, weight : number, height : number) {
}
function CURRIED_NEW_PERSON (name : string) {
return function (...args : Parameters<typeof NEW_PERSON>) { // remove index 0
return NEW_PERSON(name, ...args); // error due to 5 arguments instead of 4
}
}
How do I remove index 0 from Parameters<typeof NEW_PERSON>
?