src/util/astUtil.js
function isMemberExpOf(node, objectName, {maxLength = Number.MAX_VALUE, allowComputed} = {}) {
    if (objectName) {
        let curr = node
        let depth = maxLength
        while (curr && depth) {
            if (allowComputed || isPropAccess(curr)) {
                if (curr.type === 'MemberExpression' && curr.object.name === objectName) {
                    return true
                }
                curr = curr.object
                depth--
            } else {
                return false
            }
        }
    }
}
function isMemberExpOf(node, objectName, {maxLength = Number.MAX_VALUE, allowComputed} = {}) {
    if (objectName) {
        let curr = node
        let depth = maxLength
        while (curr && depth) {
            if (allowComputed || isPropAccess(curr)) {
                if (curr.type === 'MemberExpression' && curr.object.name === objectName) {
                    return true
                }
                curr = curr.object
                depth--
            } else {
                return false
            }
        }
    }
}
function isMemberExpOf ( node , objectName , { maxLength = Number . MAX_VALUE , allowComputed } = { } ) { if ( objectName ) { let curr = node let depth = maxLength while ( curr && depth ) { if ( allowComputed || isPropAccess ( curr ) ) { if ( curr . type === 'MemberExpression' && curr . object . name === objectName ) { return true } curr = curr . object depth -- } else { return false } } } }
Returns whether the node is a member expression starting with the same object, up to the specified length
@param {Object} node
@param {string} objectName
@param {Object} [options]
@param {number} [options.maxLength]
@param {boolean} [options.allowComputed]
@returns {boolean|undefined}
Returns whether the node is a member expression starting with the same object up to the specified length