Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/@babel/plugin-transform-react-pure-annotations/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _helperPluginUtils = require("@babel/helper-plugin-utils");
var _helperAnnotateAsPure = require("@babel/helper-annotate-as-pure");
var _core = require("@babel/core");
const PURE_CALLS = new Map([["react", ["cloneElement", "createContext", "createElement", "createFactory", "createRef", "forwardRef", "isValidElement", "memo", "lazy"]], ["react-dom", ["createPortal"]]]);
var _default = (0, _helperPluginUtils.declare)(api => {
api.assertVersion(7);
return {
name: "transform-react-pure-annotations",
visitor: {
CallExpression(path) {
if (isReactCall(path)) {
(0, _helperAnnotateAsPure.default)(path);
}
}
}
};
});
exports.default = _default;
function isReactCall(path) {
if (!_core.types.isMemberExpression(path.node.callee)) {
const callee = path.get("callee");
for (const [module, methods] of PURE_CALLS) {
for (const method of methods) {
if (callee.referencesImport(module, method)) {
return true;
}
}
}
return false;
}
for (const [module, methods] of PURE_CALLS) {
const object = path.get("callee.object");
if (object.referencesImport(module, "default") || object.referencesImport(module, "*")) {
for (const method of methods) {
if (_core.types.isIdentifier(path.node.callee.property, {
name: method
})) {
return true;
}
}
return false;
}
}
return false;
} |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.005 ]-- |