How are these different. I don't understand. All I know is that the libraries did not work until I managed to derive these two magic lines by trial and error. I don't even know whose documentation I was supposed to be looking at to understand what to do here, TypeScript's, Node's, or the ES standard/MDN. Every time I think I've Figured Out JavaScript there is some new baffling wrinkle I had no suspicion could exist.
Screaming: So I am using the json-order library. https://www.npmjs.com/package/json-order
It claims inbuilt TypeScript support.
I say:
import orderedJson from 'json-order';
I believe?? this imports the default object from the library. The TS type system now believes orderedJson has a field orderedJson.parse.
It doesn't. orderedJson contains an object named "default", which contains an object named parse. If I say:
import {default as orderedJson} from 'json-order';
That fixes it—but now TS insists it's wrong