You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
parttimejob/node_modules/@babel/plugin-transform-runtime/lib/index.js.map

1 line
12 KiB

4 weeks ago
{"version":3,"names":["_helperPluginUtils","require","_helperModuleImports","_core","_helpers","_index","_index2","_default","exports","default","declare","api","options","dirname","assertVersion","version","runtimeVersion","absoluteRuntime","moduleName","Error","DUAL_MODE_RUNTIME","supportsCJSDefault","hasMinVersion","hasOwnProperty","call","useESModules","esModules","caller","supportsStaticESM","helpers","useRuntimeHelpers","HEADER_HELPERS","Set","name","inherits","babel7","createPolyfillPlugins","pre","file","modulePath","set","_modulePath","_ref","getRuntimePath","get","availableHelper","t","arrowFunctionExpression","identifier","blockHoist","has","isModule","path","undefined","helperPath","node","sourceType","resolveFSPath","addDefaultImport","cache","Map","source","nameHint","isHelper","cacheKey","key","cached","cloneNode","addDefault","importedInterop"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport { addDefault, isModule } from \"@babel/helper-module-imports\";\nimport { types as t } from \"@babel/core\";\n\nimport { hasMinVersion } from \"./helpers.ts\";\nimport getRuntimePath, { resolveFSPath } from \"./get-runtime-path/index.ts\";\n\n// TODO(Babel 8): Remove this\nimport babel7 from \"./babel-7/index.cjs\";\n\nexport interface Options {\n absoluteRuntime?: boolean;\n corejs?: string | number | { version: string | number; proposals?: boolean };\n helpers?: boolean;\n version?: string;\n moduleName?: null | string;\n}\n\nexport default declare((api, options: Options, dirname) => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n const {\n version: runtimeVersion = \"7.0.0-beta.0\",\n absoluteRuntime = false,\n moduleName = null,\n } = options;\n\n if (\n typeof absoluteRuntime !== \"boolean\" &&\n typeof absoluteRuntime !== \"string\"\n ) {\n throw new Error(\n \"The 'absoluteRuntime' option must be undefined, a boolean, or a string.\",\n );\n }\n\n if (typeof runtimeVersion !== \"string\") {\n throw new Error(`The 'version' option must be a version string.`);\n }\n\n if (moduleName !== null && typeof moduleName !== \"string\") {\n throw new Error(\"The 'moduleName' option must be null or a string.\");\n }\n\n if (!process.env.BABEL_8_BREAKING) {\n // In recent @babel/runtime versions, we can use require(\"helper\").default\n // instead of require(\"helper\") so that it has the same interface as the\n // ESM helper, and bundlers can better exchange one format for the other.\n const DUAL_MODE_RUNTIME = \"7.13.0\";\n // eslint-disable-next-line no-var\n var supportsCJSDefault = hasMinVersion(DUAL_MODE_RUNTIME, runtimeVersion);\n }\n\n if (Object.hasOwn(options, \"useBuiltIns\")) {\n // @ts-expect-error deprecated options\n if (options[\"useBuiltIns\"]) {\n throw new Error(\n \"The 'useBuiltIns' option has been removed. The @babel/runtime \" +\n \"module now uses builtins by default.\",\n );\n } else {\n throw new Error(\n \"The 'useBuiltIns' option has been removed. Use the 'corejs'\" +\n \"option to polyfill with `core-js` via @babel/runtime.\",\n );\n }\n }\n\n if (Object.hasOwn(options, \"polyfill\")) {\n // @ts-expect-error deprecated options\n if (options[\"polyfill\"] === false) {\n throw new Error(\n \"The 'polyfill' option has been removed. The @babel/runtime \" +\n \"module now skips polyfilling by default.\",\n );\n } else {\n throw new Error(\n \"The 'polyfill' option has been removed. Use the 'corejs'\" +\n \"option to polyfill with `core-js` via @babel/runtime.\",\n );\n }\n }\n\n if (process.env.BABEL_8_BREAKING) {\n if (Object.hasOwn(options, \"regenerator\")) {\n throw new Error(\n \"The 'regenerator' option has been removed. The generators transform \" +\n \"no longers relies on a 'regeneratorRuntime' global. \" +\n \"If you still need to replace imports to the 'regeneratorRuntime' \" +\n \"global