Open stevenvachon opened 7 years ago
I'm not sure how to PR this, as detecting a URL would require a dependency:
const isURL = require('isurl');
if (isURL.lenient(expected)) {
if (isURL.lenient(actual)) {
return expected.href === actual.href;
} else {
return false;
}
}
... and this lib has been written as a UMD module.
This module is not going to support any non-standard objects. Since you can do a workaround - please do a workaround or create separate module.
Non-standard?
https://url.spec.whatwg.org https://developer.mozilla.org/en/docs/Web/API/URL
This module supports Date
, which is no more standard than URL
.
you are right, didn't noticed that there is a standart URL object. I'll keep this issue open, until I'll find some good clues, what to do with this
I have written isurl, which works cross-realm -- something that this module's Date
check should also do in order to support Worker
and Node's cluster
. But I'm not sure how to get dependencies in without adding a build step since this module is UMD.
You can probably just copy what is being done here: https://github.com/JamesMGreene/chai-deep-match/issues/2#issuecomment-297527973
It may have a standard but, as I mention many times in https://github.com/JamesMGreene/chai-deep-match/issues/2, I find it to be extremely un-semantic. 👎
@JamesMGreene it's an evolving standard. Feel free to assert your thoughts: https://github.com/whatwg/url/issues
@stevenvachon: Thanks for the info, I will.
Any update?
This works, however: