Sha256: 632d080252bfd77a456454aee9dd4bd45212bc56d6319144fc90ec1eb296950b

Contents?: true

Size: 1.25 KB

Versions: 12

Compression:

Stored size: 1.25 KB

Contents

{"version":3,"names":["_t","require","addComment","PURE_ANNOTATION","isPureAnnotated","leadingComments","some","comment","test","value","annotateAsPure","pathOrNode","node"],"sources":["../src/index.ts"],"sourcesContent":["import { addComment, type Node } from \"@babel/types\";\n\nconst PURE_ANNOTATION = \"#__PURE__\";\n\nconst isPureAnnotated = ({ leadingComments }: Node): boolean =>\n  !!leadingComments &&\n  leadingComments.some(comment => /[@#]__PURE__/.test(comment.value));\n\nexport default function annotateAsPure(\n  pathOrNode: Node | { node: Node },\n): void {\n  const node =\n    // @ts-expect-error Node will not have `node` property\n    (pathOrNode[\"node\"] || pathOrNode) as Node;\n  if (isPureAnnotated(node)) {\n    return;\n  }\n  addComment(node, \"leading\", PURE_ANNOTATION);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,EAAA,GAAAC,OAAA;AAAqD;EAA5CC;AAAU,IAAAF,EAAA;AAEnB,MAAMG,eAAe,GAAG,WAAW;AAEnC,MAAMC,eAAe,GAAGA,CAAC;EAAEC;AAAsB,CAAC,KAChD,CAAC,CAACA,eAAe,IACjBA,eAAe,CAACC,IAAI,CAACC,OAAO,IAAI,cAAc,CAACC,IAAI,CAACD,OAAO,CAACE,KAAK,CAAC,CAAC;AAEtD,SAASC,cAAcA,CACpCC,UAAiC,EAC3B;EACN,MAAMC,IAAI,GAEPD,UAAU,CAAC,MAAM,CAAC,IAAIA,UAAmB;EAC5C,IAAIP,eAAe,CAACQ,IAAI,CAAC,EAAE;IACzB;EACF;EACAV,UAAU,CAACU,IAAI,EAAE,SAAS,EAAET,eAAe,CAAC;AAC9C","ignoreList":[]}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
immosquare-cleaner-0.1.51 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.50 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.49 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.48 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.47 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.46 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.45 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.44 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.43 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.42 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.41 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map
immosquare-cleaner-0.1.40 node_modules/@babel/helper-annotate-as-pure/lib/index.js.map