How to use the putout.Identifier 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 / compare / lib / log.spec.js View on Github external
test('putout: run-plugins: template: log: object', (t) => {
    const namespace = stub();
    
    assign(namespace, {
        enabled: true,
    });
    
    const debug = stub().returns(namespace);
    
    mockRequire('debug', debug);
    
    const log = reRequire('./log');
    
    log(Identifier('hello'), Identifier('world'));
    const expected = `Identifier: "hello" = Identifier: "world"`;
    
    t.ok(namespace.calledWith(expected));
    t.end();
});
github coderaiser / putout / packages / codemod-convert-path-to-chunk / lib / convert-path-get / index.js View on Github external
module.exports.fix = (path) => {
    const id = Identifier(path.node.arguments[0].value);
    path.replaceWith(path.node.callee);
    path.property.replaceWith(id);
};
github coderaiser / putout / packages / plugin-putout / lib / convert-to-no-transform-code / index.js View on Github external
module.exports.fix = ({path, calleePath}) => {
    calleePath.node.property = Identifier('noTransformCode');
    path.node.arguments.pop();
};