Amazon Interview Question

Given an HTML form with some <input name="a.b"> that have name attributes, implement a function that converts the data into a plain Javascript object ("{ a: {b: 'my value' } }").