This commit is contained in:
2022-07-18 02:50:52 +00:00
parent befd344ab0
commit 06181b34d6
8569 changed files with 818704 additions and 352705 deletions
+3 -3
View File
@@ -2,18 +2,18 @@
> Helper function to annotate paths and nodes with #__PURE__ comment
See our website [@babel/helper-annotate-as-pure](https://babeljs.io/docs/en/next/babel-helper-annotate-as-pure.html) for more information.
See our website [@babel/helper-annotate-as-pure](https://babeljs.io/docs/en/babel-helper-annotate-as-pure) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/helper-annotate-as-pure
npm install --save @babel/helper-annotate-as-pure
```
or using yarn:
```sh
yarn add @babel/helper-annotate-as-pure --dev
yarn add @babel/helper-annotate-as-pure
```
+6 -7
View File
@@ -5,12 +5,11 @@ Object.defineProperty(exports, "__esModule", {
});
exports.default = annotateAsPure;
var t = _interopRequireWildcard(require("@babel/types"));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var _t = require("@babel/types");
const {
addComment
} = _t;
const PURE_ANNOTATION = "#__PURE__";
const isPureAnnotated = ({
@@ -18,11 +17,11 @@ const isPureAnnotated = ({
}) => !!leadingComments && leadingComments.some(comment => /[@#]__PURE__/.test(comment.value));
function annotateAsPure(pathOrNode) {
const node = pathOrNode.node || pathOrNode;
const node = pathOrNode["node"] || pathOrNode;
if (isPureAnnotated(node)) {
return;
}
t.addComment(node, "leading", PURE_ANNOTATION);
addComment(node, "leading", PURE_ANNOTATION);
}
+26 -18
View File
@@ -1,47 +1,54 @@
{
"_args": [
[
"@babel/helper-annotate-as-pure@7.10.4",
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
"@babel/helper-annotate-as-pure@7.18.6",
"/home/node/nuxt"
]
],
"_from": "@babel/helper-annotate-as-pure@7.10.4",
"_id": "@babel/helper-annotate-as-pure@7.10.4",
"_from": "@babel/helper-annotate-as-pure@7.18.6",
"_id": "@babel/helper-annotate-as-pure@7.18.6",
"_inBundle": false,
"_integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==",
"_integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==",
"_location": "/@babel/helper-annotate-as-pure",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@babel/helper-annotate-as-pure@7.10.4",
"raw": "@babel/helper-annotate-as-pure@7.18.6",
"name": "@babel/helper-annotate-as-pure",
"escapedName": "@babel%2fhelper-annotate-as-pure",
"scope": "@babel",
"rawSpec": "7.10.4",
"rawSpec": "7.18.6",
"saveSpec": null,
"fetchSpec": "7.10.4"
"fetchSpec": "7.18.6"
},
"_requiredBy": [
"/@babel/helper-create-class-features-plugin",
"/@babel/helper-create-regexp-features-plugin",
"/@babel/helper-remap-async-to-generator",
"/@babel/plugin-transform-classes",
"/@babel/plugin-transform-template-literals"
"/@babel/plugin-proposal-private-property-in-object",
"/@babel/plugin-transform-classes"
],
"_resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz",
"_spec": "7.10.4",
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
"_resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz",
"_spec": "7.18.6",
"_where": "/home/node/nuxt",
"author": {
"name": "The Babel Team",
"url": "https://babel.dev/team"
},
"bugs": {
"url": "https://github.com/babel/babel/issues"
},
"dependencies": {
"@babel/types": "^7.10.4"
"@babel/types": "^7.18.6"
},
"description": "Helper function to annotate paths and nodes with #__PURE__ comment",
"gitHead": "7fd40d86a0d03ff0e9c3ea16b29689945433d4df",
"homepage": "https://github.com/babel/babel#readme",
"engines": {
"node": ">=6.9.0"
},
"homepage": "https://babel.dev/docs/en/next/babel-helper-annotate-as-pure",
"license": "MIT",
"main": "lib/index.js",
"main": "./lib/index.js",
"name": "@babel/helper-annotate-as-pure",
"publishConfig": {
"access": "public"
@@ -51,5 +58,6 @@
"url": "git+https://github.com/babel/babel.git",
"directory": "packages/babel-helper-annotate-as-pure"
},
"version": "7.10.4"
"type": "commonjs",
"version": "7.18.6"
}