lib/index.js
function cast(value){
    if(value === undefined) return undefined;
    /*
     * Integers: 344i
     */
    if(value.match(/^\d+i$/m)){
        value = value.slice(0, -1);
        return parseInt(value);
    }

    /* boolean true
     * t, T, true, True, or TRUE
     */
    if(value.match(/^t$|^true$/im)){
        return true;
    }

    /* boolean false
     * f, F, false, False, or FALSE
     */
    if(value.match(/^f$|^false$/im)){
        return false;
    }

    /*
     * match strings
     */
    if(value.match(/^"(.*)"$/)){
        value = value.match(/^"(.*)"$/);
        if(value.length === 2){
            return value[1];
        }
    }

    if(!isNaN(value)) return parseFloat(value);

    return undefined;

}
function cast(value){
    if(value === undefined) return undefined;
    /*
     * Integers: 344i
     */
    if(value.match(/^\d+i$/m)){
        value = value.slice(0, -1);
        return parseInt(value);
    }

    /* boolean true
     * t, T, true, True, or TRUE
     */
    if(value.match(/^t$|^true$/im)){
        return true;
    }

    /* boolean false
     * f, F, false, False, or FALSE
     */
    if(value.match(/^f$|^false$/im)){
        return false;
    }

    /*
     * match strings
     */
    if(value.match(/^"(.*)"$/)){
        value = value.match(/^"(.*)"$/);
        if(value.length === 2){
            return value[1];
        }
    }

    if(!isNaN(value)) return parseFloat(value);

    return undefined;

}
function cast ( value ) { if ( value === undefined ) return undefined ; /*
     * Integers: 344i
     */ if ( value . match ( / ^\d+i$ / m ) ) { value = value . slice ( 0 , - 1 ) ; return parseInt ( value ) ; } /* boolean true
     * t, T, true, True, or TRUE
     */ if ( value . match ( / ^t$|^true$ / im ) ) { return true ; } /* boolean false
     * f, F, false, False, or FALSE
     */ if ( value . match ( / ^f$|^false$ / im ) ) { return false ; } /*
     * match strings
     */ if ( value . match ( / ^"(.*)"$ / ) ) { value = value . match ( / ^"(.*)"$ / ) ; if ( value . length === 2 ) { return value [ 1 ] ; } } if ( ! isNaN ( value ) ) return parseFloat ( value ) ; return undefined ; }
Cast each element in it's equivalent
JS type.

Note that for fields, without knowing
the type it was stored as in InfluxDB
we have to guess it's type.

This can be an issue in cases where
we have fields that are alphanumeric
with a chance of having a instance
being all digits.

Tags are all strings.

@param  {Mixed} value
@return {Mixed}
Cast each element in it s equivalent JS type .