0.12.2 • Published 4 years ago

@chialab/swc-types v0.12.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

⚠️ The development of this plugin has been suspended for maintenance reasons after an initial trial period. Developments will follow when the swc project will be more stable.


Install

$ npm i @chialab/swc-types -D
$ yarn add @chialab/swc-types -D

Usage

import { t, Visitor } from '@chialab/swc-types';

export class ConsoleVisitor extends Visitor {
    visitCallExpression(e: CallExpression): Expression {
        if (!t.isMemberExpression(e.callee)) {
            return e;
        }

        if (t.isIdentifier(e.callee.object) && e.callee.object.value === 'console') {
            if (t.isIdentifier(e.callee.property)) {
                return t.unaryExpression('void', t.numericLiteral(0));
            }
        }

        return e;
    }
}

License

SWC Types is released under the MIT license.

0.12.2

4 years ago

0.12.0

4 years ago

0.11.8

4 years ago

0.11.13

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.12

4 years ago

0.9.10

4 years ago

0.9.0

4 years ago

0.8.13

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.8

4 years ago

0.5.0

4 years ago

0.4.22

4 years ago

0.4.17

4 years ago

0.4.16

4 years ago

0.4.15

4 years ago

0.4.13

4 years ago

0.4.11

4 years ago