This repository has been archived on 2025-07-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
eternos/frontend/node_modules/@babel/helper-annotate-as-pure/lib/index.js
2025-01-13 09:33:52 +03:00

24 lines
574 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = annotateAsPure;
var _t = require("@babel/types");
const {
addComment
} = _t;
const PURE_ANNOTATION = "#__PURE__";
const isPureAnnotated = ({
leadingComments
}) => !!leadingComments && leadingComments.some(comment => /[@#]__PURE__/.test(comment.value));
function annotateAsPure(pathOrNode) {
const node = pathOrNode["node"] || pathOrNode;
if (isPureAnnotated(node)) {
return;
}
addComment(node, "leading", PURE_ANNOTATION);
}
//# sourceMappingURL=index.js.map