Closed fregante closed 1 year ago
there's no location here ... it's SSR: you define the location? add a global class would be my answer but that might not solve, right?
This is not a location?
const {window} = parseHTML('')
window.location
I'm just asking window.location
to be an instance of window.Location
, which currently doesn't exist in the first place.
I already know what a workaround would be, I'm suggesting to add a class so that I don't need to work around this.
If it doesn't belong to linkedom because you want to keep it light, that's fair.
If location is exposed (can’t remember, sorry) then it’s ok to expose Location class.
mind filing a PR?
actually ... tests show that location is something you pass along, so you can add Location globally, or should I check if location is available (passed) and return its proto constructor?
Closing as no interest shown whatsoever for more than a month.
Due to some TypeScript code that uses
instanceof Location
to tell an argument apart from other types of URLs, I'd need this global class. I was unable to locate where exactly thelocation
property is generated in this codebase.