Closed tjmehta closed 9 years ago
apologies for the whitespace trimming messing up the diff (me editor does it automatically)
This looks like a good PR but I don't understand correctly what the problem is. Can you give a simple example that shows what input is required to get incorrect output?
Hey Dominic,
Check out the second to last commit on the PR branch: it shows the broken test without the fix.
When an empty chunk is split by empty it results in an empty array ('pieces') making 'soFar' 'null'. When the next chunk passes through split it is prepended with 'soFar' which is 'undefined'.
—@tjmehta Typed using my thumbs..
On Sun, Feb 1, 2015 at 5:25 PM, Dominic Tarr notifications@github.com wrote:
This looks like a good PR but I don't understand correctly what the problem is.
Can you give a simple example that shows what input is required to get incorrect output?
Reply to this email directly or view it on GitHub: https://github.com/dominictarr/split/pull/14#issuecomment-72395845
thanks, I saw the event-stream issue after this one and merged it.
On Mon, Feb 2, 2015 at 8:17 PM, Tejesh Mehta notifications@github.com wrote:
Hey Dominic,
Check out the second to last commit on the PR branch: it shows the broken test without the fix.
When an empty chunk is split by empty it results in an empty array ('pieces') making 'soFar' 'null'. When the next chunk passes through split it is prepended with 'soFar' which is 'undefined'.
—@tjmehta Typed using my thumbs..
On Sun, Feb 1, 2015 at 5:25 PM, Dominic Tarr notifications@github.com wrote:
This looks like a good PR but I don't understand correctly what the problem is. Can you give a simple example that shows what input is required to get
incorrect output?
Reply to this email directly or view it on GitHub: https://github.com/dominictarr/split/pull/14#issuecomment-72395845
— Reply to this email directly or view it on GitHub https://github.com/dominictarr/split/pull/14#issuecomment-72415072.
merged into 0.3.3
On Mon, Feb 2, 2015 at 11:09 PM, Dominic Tarr dominic.tarr@gmail.com wrote:
thanks, I saw the event-stream issue after this one and merged it.
On Mon, Feb 2, 2015 at 8:17 PM, Tejesh Mehta notifications@github.com wrote:
Hey Dominic,
Check out the second to last commit on the PR branch: it shows the broken test without the fix.
When an empty chunk is split by empty it results in an empty array ('pieces') making 'soFar' 'null'. When the next chunk passes through split it is prepended with 'soFar' which is 'undefined'.
—@tjmehta Typed using my thumbs..
On Sun, Feb 1, 2015 at 5:25 PM, Dominic Tarr notifications@github.com wrote:
This looks like a good PR but I don't understand correctly what the problem is. Can you give a simple example that shows what input is required to get
incorrect output?
Reply to this email directly or view it on GitHub: https://github.com/dominictarr/split/pull/14#issuecomment-72395845
— Reply to this email directly or view it on GitHub https://github.com/dominictarr/split/pull/14#issuecomment-72415072.
I noticed when using
es.replace
to remove whitespace using multiple RegExps, that if a split resulted in empty string chunks 'undefined' was being inserted into the stream. I will PR a test case and split-version-bump in event-stream fores.replace
shortly.