Why is this:
const test: {} = "test" // shouldn't this raise "Type 'string' is not assignable to type '{}'." error?
console.log(test)
A valid Typescript code?
Just a moment ago this bit of code caused me to send wrong API calls, because I had something like this:
const getAPIData = async (id: string, filters: NetworkFilters | {} = {})
What I wanted to achieve is the filters prop to have default value of object with no properties, but by my mistake I passed string there and this broke my API calls. Why is it possible? It should raise an error.