| Total Complexity | 8 |
| Complexity/F | 4 |
| Lines of Code | 21 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | jQuery.fn.serializeObject = function() |
||
| 2 | { |
||
| 3 | var o = {}; |
||
| 4 | var a = this.serializeArray(); |
||
| 5 | jQuery.each(a, function() { |
||
| 6 | var value; |
||
| 7 | if (o[this.name] !== undefined) { |
||
| 8 | if (!o[this.name].push) { |
||
| 9 | o[this.name] = [o[this.name]]; |
||
| 10 | } |
||
| 11 | value = (this.value === 'on') ? true : this.value; |
||
| 12 | value = (value === 'off') ? false : value; |
||
| 13 | o[this.name].push(value || ''); |
||
| 14 | } else { |
||
| 15 | value = (this.value === 'on') ? true : this.value; |
||
| 16 | value = (value === 'off') ? false : value; |
||
| 17 | o[this.name] = value; |
||
| 18 | } |
||
| 19 | }); |
||
| 20 | return o; |
||
| 21 | }; |
||
| 22 |