If you don't specify line endings to use, ie. leave it to be auto-detected, then the \r\n seems to only be detected once it reaches the end of the first line (which admittedly makes sense), but by then transformHeader() already got called with the header fields and the last one will contain the \r that preceded that first \n, allowing it to detect \r\n.
Similarly result.meta.fields' last element also has the \r at the end.
I'm working around this in my code, but thought I'd mention it here anyway as it is likely not what's intended.
If you don't specify line endings to use, ie. leave it to be auto-detected, then the \r\n seems to only be detected once it reaches the end of the first line (which admittedly makes sense), but by then transformHeader() already got called with the header fields and the last one will contain the \r that preceded that first \n, allowing it to detect \r\n.
Similarly result.meta.fields' last element also has the \r at the end.
I'm working around this in my code, but thought I'd mention it here anyway as it is likely not what's intended.