Closed joshschumacher closed 11 years ago
Wow that looks sexy.
Sent from my iPhone
On 2 Oct 2013, at 16:11, Josh Schumacher notifications@github.com wrote:
Re-wrote Arg._access method
Will now optionally coerce a native type out of value if possible (ie Number, Boolean, undefined, etc). To not coerce, set Arg.coerceMode = false Better handling of complex objects that have mixed nested objects/arrays. See new test case added to test/spec/arg.js for an example object that was failing and is no longer failing. Removed the need for boolean shouldSet value passed to Arg._access. Now assumes if value is undefined that you are in get mode and shouldSet = false. You can merge this Pull Request by running
git pull https://github.com/joshschumacher/arg.js master Or view, comment on, or merge it at:
https://github.com/stretchr/arg.js/pull/11
Commit Summary
Fixed issues in parse causing improperly parsed complex query strings File Changes
M src/arg.js (90) M test/spec/arg.js (105) Patch Links:
https://github.com/stretchr/arg.js/pull/11.patch https://github.com/stretchr/arg.js/pull/11.diff
Re-wrote
Arg._access
methodArg.coerceMode = false
test/spec/arg.js
for an example object that was failing and is no longer failing.shouldSet
value passed toArg._access
. Now assumes ifvalue
is undefined that you are in get mode andshouldSet = false
.