We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5f9fe40 commit 61dc73fCopy full SHA for 61dc73f
index.js
@@ -13,6 +13,29 @@
13
module.exports = function (babel) {
14
return {
15
visitor: {
16
+ AssignmentExpression: {
17
+ enter: function (nodePath, pluginPass) {
18
+ if (!nodePath.equals('operator', '=')) {
19
+ return;
20
+ }
21
+ var left = nodePath.get('left');
22
+ if (!left.isIdentifier()) {
23
24
25
+ if (!left.equals('name', 'assert')) {
26
27
28
+ var right = nodePath.get('right');
29
+ if (!right.isCallExpression()) {
30
31
32
+ var callee = right.get('callee');
33
+ var arg = right.get('arguments')[0];
34
+ if (isRequireAssert(callee, arg)) {
35
+ arg.set('value', 'power-assert');
36
37
38
+ },
39
VariableDeclarator: {
40
enter: function (nodePath, pluginPass) {
41
var id = nodePath.get('id');
0 commit comments