03dbc78e83030794ae448b901d39f2d8486bff4dc07032f993edd61f04c1f4f81eb06543f1201c29a1669969a7fde59c9d61ebb787b6dae10322583eff031a 574 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = annotateAsPure;
  6. var _t = require("@babel/types");
  7. const {
  8. addComment
  9. } = _t;
  10. const PURE_ANNOTATION = "#__PURE__";
  11. const isPureAnnotated = ({
  12. leadingComments
  13. }) => !!leadingComments && leadingComments.some(comment => /[@#]__PURE__/.test(comment.value));
  14. function annotateAsPure(pathOrNode) {
  15. const node = pathOrNode["node"] || pathOrNode;
  16. if (isPureAnnotated(node)) {
  17. return;
  18. }
  19. addComment(node, "leading", PURE_ANNOTATION);
  20. }
  21. //# sourceMappingURL=index.js.map