Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding failues on objects containing a 'length' key #126

Merged
merged 1 commit into from
Apr 18, 2016

Conversation

connor4312
Copy link
Member

This adds a test case and fixes encoding failures when trying to write data that contains a "length" key or value. Prior to these fixes the added test case would fail with:

Previously the _.createKey*String was using _.map which, while it worked over objects, was actually a lodash method to work on collections. Evidently the logic lodash used to decide whether something was a collection or an object was to see if it had a length key, so objects that did contain a length key were treated as arrays. This PR replaces it with _.forOwn to explicitly iterate over enumerable properties.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 99.187% when pulling f3900e5 on WatchBeam:master into cd38892 on node-influx:master.

@connor4312
Copy link
Member Author

Amended my commit to fix style errors

@coveralls
Copy link

Coverage Status

Coverage increased (+0.008%) to 99.187% when pulling f901237 on WatchBeam:master into cd38892 on node-influx:master.

@bencevans bencevans merged commit b89f107 into node-influx:master Apr 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants