sanitation.js
function objValByStr(name, separator, context) {
    var func, i, n, ns, _i, _len;
    if (!name || !separator || !context) {
        return null;
    }
    ns = name.split(separator);
    func = context;
    try {
        for (i = _i = 0, _len = ns.length; _i < _len; i = ++_i) {
            n = ns[i];
            func = func[n];
        }
        return func;
    } catch (e) {
        return e;
    }
}
function objValByStr(name, separator, context) {
    var func, i, n, ns, _i, _len;
    if (!name || !separator || !context) {
        return null;
    }
    ns = name.split(separator);
    func = context;
    try {
        for (i = _i = 0, _len = ns.length; _i < _len; i = ++_i) {
            n = ns[i];
            func = func[n];
        }
        return func;
    } catch (e) {
        return e;
    }
}
function objValByStr ( name , separator , context ) { var func , i , n , ns , _i , _len ; if ( ! name || ! separator || ! context ) { return null ; } ns = name . split ( separator ) ; func = context ; try { for ( i = _i = 0 , _len = ns . length ; _i < _len ; i = ++ _i ) { n = ns [ i ] ; func = func [ n ] ; } return func ; } catch ( e ) { return e ; } }
Returns the value of the nested object based on string path and the separator provided.
@param {String} name The path of the nested object structure to fetch the value.
@param {String} separator The identifier to split the string to iterate over the JSON object keys.
@param {Object} context The original nested JSON object.
Returns the value of the nested object based on string path and the separator provided .