getData = data => {
    if (data === 'true') {
        return true
    }

    if (data === 'false') {
        return false
    }

    if (data === 'null') {
        return null
    }

    // Only convert to a number if it doesn't change the string
    if (data === +data+'') {
        return +data
    }

    if (rbrace.test(data)) {
        return JSON.parse(data)
    }

    return data
}
Parse value to data type.

@link   https://github.com/jquery/jquery/blob/3.1.1/src/data.js
@param  {string} data - value to convert
@return {mixed}  value in its natural data type