Closed osm closed 3 years ago
I'm not strongly opposed to allowing this, but after perusing RFC 5322 quickly, and considering the security aspects of the Display Name, I'm not convinced it should default to enabled. I think the feature should default to off.
That sounds reasonable.
I decided to add an options object after the startAt
parameter that lets the user toggle comma in display name parsing. It would have been nicer to also include the startAt
parameter within the options object but that would mean a breaking change. So I think this is probably the best way to do it.
Switching to an object for passing in arguments is the right approach. The called function can check the argument type to maintain backwards compatibility.
Yeah it's nicer, with the latest commit I've changed it to allow for an object to be passed instead and at the same time also accept anything else and use that as the startAt parameter to keep backwards compatibility.
And while you're at it, please update Changes.md and bump the version number in package.json.
This is a similar PR as I made earlier https://github.com/haraka/node-address-rfc2822/pull/47, but this time it allows
,
in the display name.The feature was added to the email-addresses library with this PR: https://github.com/jackbearheart/email-addresses/pull/54