UNPKG

react-router-ga

Version:

[![Downloads](https://img.shields.io/npm/dm/react-router-ga)](https://npm.im/react-router-ga) [![Version](https://img.shields.io/npm/v/react-router-ga)](https://npm.im/react-router-ga) [![License](https://img.shields.io/npm/l/react-router-ga)](https://ope

31 lines (23 loc) 684 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = rewriteThis; var _helperReplaceSupers = require("@babel/helper-replace-supers"); function rewriteThis(programPath) { programPath.traverse(rewriteThisVisitor); } const rewriteThisVisitor = { ThisExpression(path) { path.replaceWith(path.scope.buildUndefinedNode()); }, Function(path) { if (path.isMethod()) (0, _helperReplaceSupers.skipAllButComputedKey)(path);else if (!path.isArrowFunctionExpression()) path.skip(); }, ClassProperty(path) { (0, _helperReplaceSupers.skipAllButComputedKey)(path); }, ClassPrivateProperty(path) { path.skip(); } };