1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/@babel/helper-annotate-as-pure/lib/index.js

24 lines
574 B
JavaScript
Raw Normal View History

2023-12-18 13:12:25 +08:00
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = annotateAsPure;
2024-01-16 21:26:16 +08:00
var _t = require("@babel/types");
const {
addComment
} = _t;
2023-12-18 13:12:25 +08:00
const PURE_ANNOTATION = "#__PURE__";
const isPureAnnotated = ({
leadingComments
}) => !!leadingComments && leadingComments.some(comment => /[@#]__PURE__/.test(comment.value));
function annotateAsPure(pathOrNode) {
2024-01-16 21:26:16 +08:00
const node = pathOrNode["node"] || pathOrNode;
2023-12-18 13:12:25 +08:00
if (isPureAnnotated(node)) {
return;
}
2024-01-16 21:26:16 +08:00
addComment(node, "leading", PURE_ANNOTATION);
}
2023-12-18 13:12:25 +08:00
2024-01-16 21:26:16 +08:00
//# sourceMappingURL=index.js.map