Skip to content

handle arrays without errors#14

Merged
finnp merged 1 commit intomax-mapper:masterfrom
finnp:array-fix
Nov 12, 2014
Merged

handle arrays without errors#14
finnp merged 1 commit intomax-mapper:masterfrom
finnp:array-fix

Conversation

@finnp
Copy link
Copy Markdown
Collaborator

@finnp finnp commented Nov 12, 2014

Hey,

I just took some time to actually understand to how the module works...

And the problem I was having in #13 was quite simply due to arrays as values. What happened whas that the '(/['+sep+'\\r\\n"]/.test('+prop+') part always was true on the implicit to string conversion of array properties (since [1,2].toString() contains a comma :D).

Just turning the property to a string solves it and doesn't seem to add time to the benchmark on my computer (+"" seems to be faster the .toString())

I also added a test for it. It would probably also be cool to add a jsonMode, which would actually stringify those array and object properties correctly.

Best,
Finn

finnp added a commit that referenced this pull request Nov 12, 2014
handle arrays without errors
@finnp finnp merged commit 85ba94d into max-mapper:master Nov 12, 2014
@finnp
Copy link
Copy Markdown
Collaborator Author

finnp commented Nov 12, 2014

published as 0.2.2

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.

1 participant