dist/modules/object.js
function has(obj, key) {
    if (!is_1.isObject(obj) || (!is_1.isArray(key) && !is_1.isString(key)))
        return false;
    obj = assign({}, obj);
    var props = is_1.isArray(key) ? key : string_1.split(key);
    while (props.length && obj) {
        var prop = props.shift(), match = matchIndex(prop);
        if (!props.length) { // no more props chek path.
            var _keys = array_1.keys(obj);
            if (match) {
                return array_1.contains(_keys, match.name) && is_1.isValue(obj[match.name][match.index]);
            }
            else {
                return array_1.contains(_keys, prop);
            }
        }
        if (match) {
            /* istanbul ignore next  */
            if (!is_1.isUndefined(obj[match.name])) {
                obj = obj[match.name][match.index];
                // iterate each indices and set obj to that index.
                match.indices.forEach(function (i) { return obj = obj[i]; });
            }
        }
        else {
            obj = obj[prop];
        }
    }
}
function has(obj, key) {
    if (!is_1.isObject(obj) || (!is_1.isArray(key) && !is_1.isString(key)))
        return false;
    obj = assign({}, obj);
    var props = is_1.isArray(key) ? key : string_1.split(key);
    while (props.length && obj) {
        var prop = props.shift(), match = matchIndex(prop);
        if (!props.length) { // no more props chek path.
            var _keys = array_1.keys(obj);
            if (match) {
                return array_1.contains(_keys, match.name) && is_1.isValue(obj[match.name][match.index]);
            }
            else {
                return array_1.contains(_keys, prop);
            }
        }
        if (match) {
            /* istanbul ignore next  */
            if (!is_1.isUndefined(obj[match.name])) {
                obj = obj[match.name][match.index];
                // iterate each indices and set obj to that index.
                match.indices.forEach(function (i) { return obj = obj[i]; });
            }
        }
        else {
            obj = obj[prop];
        }
    }
}
function has ( obj , key ) { if ( ! is_1 . isObject ( obj ) || ( ! is_1 . isArray ( key ) && ! is_1 . isString ( key ) ) ) return false ; obj = assign ( { } , obj ) ; var props = is_1 . isArray ( key ) ? key : string_1 . split ( key ) ; while ( props . length && obj ) { var prop = props . shift ( ) , match = matchIndex ( prop ) ; if ( ! props . length ) { // no more props chek path. var _keys = array_1 . keys ( obj ) ; if ( match ) { return array_1 . contains ( _keys , match . name ) && is_1 . isValue ( obj [ match . name ] [ match . index ] ) ; } else { return array_1 . contains ( _keys , prop ) ; } } if ( match ) { /* istanbul ignore next  */ if ( ! is_1 . isUndefined ( obj [ match . name ] ) ) { obj = obj [ match . name ] [ match . index ] ; // iterate each indices and set obj to that index. match . indices . forEach ( function ( i ) { return obj = obj [ i ] ; } ) ; } } else { obj = obj [ prop ] ; } } }
Has
Checks if property exists in object.

@param obj the object to be inpsected.
@param key the key to be found.
Has Checks if property exists in object .