From 06823fbf1c2e763a5bf76c3990ca98fbbcd98691 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 14 May 2024 14:05:49 +0800 Subject: updated node_modules --- node_modules/@babel/helper-plugin-utils/README.md | 2 +- node_modules/@babel/helper-plugin-utils/lib/index.js | 8 ++------ node_modules/@babel/helper-plugin-utils/lib/index.js.map | 2 +- node_modules/@babel/helper-plugin-utils/package.json | 5 ++++- 4 files changed, 8 insertions(+), 9 deletions(-) (limited to 'node_modules/@babel/helper-plugin-utils') diff --git a/node_modules/@babel/helper-plugin-utils/README.md b/node_modules/@babel/helper-plugin-utils/README.md index c17852d3..a99070f3 100644 --- a/node_modules/@babel/helper-plugin-utils/README.md +++ b/node_modules/@babel/helper-plugin-utils/README.md @@ -2,7 +2,7 @@ > General utilities for plugins to use -See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/en/babel-helper-plugin-utils) for more information. +See our website [@babel/helper-plugin-utils](https://babeljs.io/docs/babel-helper-plugin-utils) for more information. ## Install diff --git a/node_modules/@babel/helper-plugin-utils/lib/index.js b/node_modules/@babel/helper-plugin-utils/lib/index.js index bad40f8a..b8b73662 100644 --- a/node_modules/@babel/helper-plugin-utils/lib/index.js +++ b/node_modules/@babel/helper-plugin-utils/lib/index.js @@ -33,21 +33,17 @@ function declare(builder) { return builder((_clonedApi2 = clonedApi) != null ? _clonedApi2 : api, options || {}, dirname); }; } -const declarePreset = declare; -exports.declarePreset = declarePreset; +const declarePreset = exports.declarePreset = declare; function copyApiObject(api) { let proto = null; if (typeof api.version === "string" && /^7\./.test(api.version)) { proto = Object.getPrototypeOf(api); - if (proto && (!has(proto, "version") || !has(proto, "transform") || !has(proto, "template") || !has(proto, "types"))) { + if (proto && (!hasOwnProperty.call(proto, "version") || !hasOwnProperty.call(proto, "transform") || !hasOwnProperty.call(proto, "template") || !hasOwnProperty.call(proto, "types"))) { proto = null; } } return Object.assign({}, proto, api); } -function has(obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key); -} function throwVersionError(range, version) { if (typeof range === "number") { if (!Number.isInteger(range)) { diff --git a/node_modules/@babel/helper-plugin-utils/lib/index.js.map b/node_modules/@babel/helper-plugin-utils/lib/index.js.map index b5d1c6c0..8f2a243a 100644 --- a/node_modules/@babel/helper-plugin-utils/lib/index.js.map +++ b/node_modules/@babel/helper-plugin-utils/lib/index.js.map @@ -1 +1 @@ -{"version":3,"names":["apiPolyfills","assertVersion","api","range","throwVersionError","version","Object","assign","targets","assumption","undefined","declare","builder","options","dirname","_clonedApi2","clonedApi","name","keys","_clonedApi","copyApiObject","declarePreset","exports","proto","test","getPrototypeOf","has","obj","key","prototype","hasOwnProperty","call","Number","isInteger","Error","limit","stackTraceLimit","err","slice","code"],"sources":["../src/index.ts"],"sourcesContent":["import type {\n PluginAPI,\n PluginObject,\n PluginPass,\n PresetAPI,\n PresetObject,\n} from \"@babel/core\";\n\ntype APIPolyfillFactory = (\n api: PluginAPI,\n) => PluginAPI[T];\n\ntype APIPolyfills = {\n assertVersion: APIPolyfillFactory<\"assertVersion\">;\n};\n\nconst apiPolyfills: APIPolyfills = {\n // Not supported by Babel 7 and early versions of Babel 7 beta.\n // It's important that this is polyfilled for older Babel versions\n // since it's needed to report the version mismatch.\n assertVersion: (api: PluginAPI) => (range: number | string) => {\n throwVersionError(range, api.version);\n },\n};\nif (!process.env.BABEL_8_BREAKING) {\n Object.assign(apiPolyfills, {\n // This is supported starting from Babel 7.13\n targets: () => () => {\n return {};\n },\n // This is supported starting from Babel 7.13\n assumption: () => () => {\n return undefined;\n },\n });\n}\n\nexport function declare(\n builder: (\n api: PluginAPI,\n options: Option,\n dirname: string,\n ) => PluginObject,\n): (\n api: PluginAPI,\n options: Option,\n dirname: string,\n) => PluginObject {\n return (api, options: Option, dirname: string) => {\n let clonedApi: PluginAPI;\n\n for (const name of Object.keys(\n apiPolyfills,\n ) as (keyof typeof apiPolyfills)[]) {\n if (api[name]) continue;\n\n clonedApi ??= copyApiObject(api);\n clonedApi[name] = apiPolyfills[name](clonedApi);\n }\n\n // @ts-expect-error options || {} may not be assigned to Options\n return builder(clonedApi ?? api, options || {}, dirname);\n };\n}\n\nexport const declarePreset = declare as