0.12.2 • Published 3 years ago

@chialab/swc-types v0.12.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 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

3 years ago

0.12.0

3 years ago

0.11.8

3 years ago

0.11.13

3 years ago

0.11.0

3 years ago

0.10.0

3 years ago

0.9.12

3 years ago

0.9.10

3 years ago

0.9.0

3 years ago

0.8.13

3 years ago

0.8.0

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.8

3 years ago

0.5.0

3 years ago

0.4.22

3 years ago

0.4.17

3 years ago

0.4.16

3 years ago

0.4.15

3 years ago

0.4.13

3 years ago

0.4.11

3 years ago