mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-11 14:14:36 +08:00
This Cl is the output of the following command: npm run install-deps -- dedupe This is an attempt to reduce the amount of disk usage of the node_modules folder. For more information, see https://github.com/eslint/eslint/issues/14098 DISABLE_THIRD_PARTY_CHECK=NPM dedupe R=jacktfranklin@chromium.org Bug: none Change-Id: If482ec6cf6ad1936aab4a7b0ff3e61bf5ea98a8f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2703961 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
38 lines
1.3 KiB
JavaScript
38 lines
1.3 KiB
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.hooks = void 0;
|
|
const hooks = [function (self, parent) {
|
|
const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
|
|
|
|
if (removeParent) {
|
|
parent.remove();
|
|
return true;
|
|
}
|
|
}, function (self, parent) {
|
|
if (parent.isSequenceExpression() && parent.node.expressions.length === 1) {
|
|
parent.replaceWith(parent.node.expressions[0]);
|
|
return true;
|
|
}
|
|
}, function (self, parent) {
|
|
if (parent.isBinary()) {
|
|
if (self.key === "left") {
|
|
parent.replaceWith(parent.node.right);
|
|
} else {
|
|
parent.replaceWith(parent.node.left);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}, function (self, parent) {
|
|
if (parent.isIfStatement() && (self.key === "consequent" || self.key === "alternate") || self.key === "body" && (parent.isLoop() || parent.isArrowFunctionExpression())) {
|
|
self.replaceWith({
|
|
type: "BlockStatement",
|
|
body: []
|
|
});
|
|
return true;
|
|
}
|
|
}];
|
|
exports.hooks = hooks; |