1"use strict"; 2 3Object.defineProperty(exports, "__esModule", { 4 value: true 5}); 6exports.default = annotateAsPure; 7 8var t = require("@babel/types"); 9 10const PURE_ANNOTATION = "#__PURE__"; 11 12const isPureAnnotated = ({ 13 leadingComments 14}) => !!leadingComments && leadingComments.some(comment => /[@#]__PURE__/.test(comment.value)); 15 16function annotateAsPure(pathOrNode) { 17 const node = pathOrNode["node"] || pathOrNode; 18 19 if (isPureAnnotated(node)) { 20 return; 21 } 22 23 t.addComment(node, "leading", PURE_ANNOTATION); 24}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.