(input)
| 5 | * @return {*} parsed input |
| 6 | */ |
| 7 | export default function parse(input) { |
| 8 | let value = input |
| 9 | try { |
| 10 | value = JSON.parse(input) |
| 11 | if (value === 'true') return true |
| 12 | if (value === 'false') return false |
| 13 | if (isObject(value)) return value |
| 14 | if (parseFloat(value) === value) { |
| 15 | value = parseFloat(value) |
| 16 | } |
| 17 | } catch (e) { } |
| 18 | if (value === null || value === "") { |
| 19 | return |
| 20 | } |
| 21 | return value |
| 22 | } |
no test coverage detected