How to use the putout.isMemberExpression function in putout

To help you get started, we’ve selected a few putout examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coderaiser / putout / packages / plugin-react-hooks / lib / convert-state-to-hooks / index.js View on Github external
function isThis(init, name) {
    if (!isMemberExpression(init))
        return;
    
    const {
        object,
        property,
    } = init;
    
    return isThisExpression(object) && isIdentifier(property, {name});
}
github coderaiser / putout / packages / plugin-react-hooks / lib / convert-state-to-hooks / index.js View on Github external
function isInitState(path) {
    const {node} = path;
    const {
        left,
        right,
    } = node;
    
    if (!isMemberExpression(left))
        return false;
    
    if (!isThisState(left))
        return false;
    
    if (!isObjectExpression(right))
        return false;
    
    return true;
}
github coderaiser / putout / packages / codemod-convert-path-to-chunk / lib / convert-path-get / index.js View on Github external
CallExpression(chunk) {
            if (!isMemberExpression(chunk.callee))
                return;
            
            const {property} = chunk.callee;
            
            if (property.name !== 'get')
                return;
            
            push(chunk);
        },
    });