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

Add mixed array and object dot notation support Closes: #47 #66

Merged
merged 3 commits into from
May 21, 2015
Merged

Add mixed array and object dot notation support Closes: #47 #66

merged 3 commits into from
May 21, 2015

Conversation

AlexMeah
Copy link
Contributor

No description provided.

@@ -83,6 +83,10 @@ internals.parseKeys = function (key, val, options) {
return;
}

// Transform dot notation to bracket notation

key = key.replace(/\.(\w+)/g, '[$1]');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels too strict, \w is alphanumeric plus underscores, so it rules out plenty of valid characters. Maybe better to make it /\.([^\.\[]+)/.

I'm also curious how big of a hit this has on performance..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the regex.

What is the best way to measure perf? A few console logs show the speed to be the same as before.

@nlf
Copy link
Collaborator

nlf commented Jan 13, 2015

I'm trying to think of scenarios this might not work, but this is definitely the simplest solution for 90+% of use cases.

I'm still undecided how flexible I want this module to be, since there's been a ton of bikeshedding and debate over what it should do and how. Part of me thinks it should support as many use cases as possible, but the other part of me realizes it borders on crazy to do that and I should just keep what it does clearly defined and move on.

I'm still chewing on this, and I'll get back to it, but thanks for the effort so far!

@AlexMeah
Copy link
Contributor Author

We bumped into this issue when dealing with a legacy .net application which has to remain unchanged.

We need to being accepting form submissions using express-body-parser and would like to avoid using a custom implementation on specific routes.

Thanks for the feedback.

@nijikokun
Copy link

👍

@nlf nlf self-assigned this Mar 19, 2015
@AlexMeah
Copy link
Contributor Author

AlexMeah commented May 7, 2015

Any movement on this?

@hueniverse
Copy link
Contributor

@nlf this is a 4 months old pull request. Please merge or close.

@nlf nlf added this to the 3.0.0 milestone May 21, 2015
nlf added a commit that referenced this pull request May 21, 2015
Add mixed array and object dot notation support Closes: #47
@nlf nlf merged commit f48ea7e into ljharb:master May 21, 2015
@nlf nlf mentioned this pull request May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants