maxatwork/form2js — Issue #19: Ruby Style Arrays not Working
Author: GeekTantra
Created: 2011-11-12 00:21:47+00:00
State: open

Ruby style arrays are not working for level 1 type arrays as follows:

testitem[test_property]

But it works for:

test.item[testproperty]

I guess the error is in

line 103
-	if (namePart.length > 1)
+	if (namePart.length > 0)

and

line 120
-	arrIdx = namePart[k].match(/([a-z_]+)?\[([a-z_][a-z0-9]+?)\]/i);
+	arrIdx = namePart[k].match(/([a-z_]+)?\[([a-z_][a-z0-9_]+?)\]/i);