I have the following
sortByCounter = (ps: any) => {
return Object.values(ps).sort(
(a: any, b: any) => {
return (a.Counter >= b.Counter)
? -1 : 1;
}
);
}
Which causes typescript to say
Property 'Counter' does not exist on
type 'unknown'.
the reason why I haven't just made an interface for the object with Counter on it is because there are a lot of other possible properties on the object as well.
I have tried the LooseObject solution described in How do I dynamically assign properties to an object in TypeScript? but (replace all any with LooseObject) but it still keeps telling me that Counter does not exist on type unknown.
in fact I am as yet not using the code anywhere, just it's mere existence (which VS Code says is fine) causes typescript to crash my application.