How to use the putout.generate 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-extract-object-properties / lib / equal-deep / index.js View on Github external
if (!path.parentPath.get('id').isObjectPattern())
                return;
            
            const objectPath = path.get('object');
            const object = objectPath.node;
            
            if (objectPath.isIdentifier())
                return add({
                    name: generate(object).code,
                    items,
                    path,
                });
            
            if (objectPath.isCallExpression())
                return add({
                    name: generate(objectPath.node).code,
                    items,
                    path,
                });
        },
    });
github coderaiser / putout / packages / plugin-extract-object-properties / lib / equal-deep / index.js View on Github external
MemberExpression(path) {
            if (!path.parentPath.isVariableDeclarator())
                return;
            
            if (path.node.property.name === 'default')
                return;
            
            if (!path.parentPath.get('id').isObjectPattern())
                return;
            
            const objectPath = path.get('object');
            const object = objectPath.node;
            
            if (objectPath.isIdentifier())
                return add({
                    name: generate(object).code,
                    items,
                    path,
                });
            
            if (objectPath.isCallExpression())
                return add({
                    name: generate(objectPath.node).code,
                    items,
                    path,
                });
        },
    });