Closed TimothyGu closed 7 years ago
In general: This is amazing stuff. Thank you so much for this!
Converted the entire repo to Node.js v6+, also fixed a couple more test cases so that all of them pass (fixes #6). This should be ready to merge now.
Just a note, maybe we should consider revising the API to be a bit more palatable, like (default value after =
):
tr46.toASCII(domainName, {
checkHyphens = false,
checkBidi = false,
checkJoiners = false,
useSTD3ASCIIRules = false,
// Perhaps also use a string or a symbol that's more self-documenting than a number
processingOption = tr46.NONTRANSITIONAL,
verifyDnsLength = false
});
rather than
tr46.toASCII(domainName, useSTD3, processingOption, verifyDnsLength, checkHyphens, checkBidi, checkJoiners);
Compatibility must be broken, of course, but since we are probably releasing a 1.0.0 after this PR anyway, it shouldn't be as big of a concern as it could be.
I'd be happy to implement this change.
Compatibility must be broken, of course, but since we are probably releasing a 1.0.0 after this PR anyway, it shouldn't be as big of a concern as it could be.
Yeah, I think at this point the parameter list is getting a bit too long. Options argument would be very nice.
@Sebmaster done.
@Sebmaster if we're fixing the public API anyway, WDYT of complying to the usual JS pattern for enums so you can do processingOption: "transitional"
/ processingOption: "nontransitional"
?
Since we're going that way already anyways. Might as well. Provide constants + make them simple strings which may be provided as well?
I've never been a fan of providing the constants myself but shrug.
As an aside, I wonder why they didn't make transitional processing another boolean flag...
Filed an issue with Unicode: https://github.com/whatwg/url/issues/53#issuecomment-309243069
Also there are some unused vars now which we can drop?
Constants removed.
Seems like lint is still failing because of the unused vars.
@Sebmaster Fixed, sorry.
Tables updated to the released 10.0.0 standard.
@Sebmaster ping
Also update and make the entire test suite pass.