source: frontend/node_modules/@babel/helper-plugin-utils/lib/index.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 2.5 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.declare = declare;
7exports.declarePreset = void 0;
8const apiPolyfills = {
9 assertVersion: api => range => {
10 throwVersionError(range, api.version);
11 }
12};
13Object.assign(apiPolyfills, {
14 targets: () => () => {
15 return {};
16 },
17 assumption: () => () => {
18 return undefined;
19 },
20 addExternalDependency: () => () => {}
21});
22function declare(builder) {
23 return (api, options, dirname) => {
24 let clonedApi;
25 for (const name of Object.keys(apiPolyfills)) {
26 if (api[name]) continue;
27 clonedApi != null ? clonedApi : clonedApi = copyApiObject(api);
28 clonedApi[name] = apiPolyfills[name](clonedApi);
29 }
30 return builder(clonedApi != null ? clonedApi : api, options || {}, dirname);
31 };
32}
33const declarePreset = exports.declarePreset = declare;
34function copyApiObject(api) {
35 let proto = null;
36 if (typeof api.version === "string" && api.version.startsWith("7.")) {
37 proto = Object.getPrototypeOf(api);
38 if (proto && (!hasOwnProperty.call(proto, "version") || !hasOwnProperty.call(proto, "transform") || !hasOwnProperty.call(proto, "template") || !hasOwnProperty.call(proto, "types"))) {
39 proto = null;
40 }
41 }
42 return Object.assign({}, proto, api);
43}
44function throwVersionError(range, version) {
45 if (typeof range === "number") {
46 if (!Number.isInteger(range)) {
47 throw new Error("Expected string or integer value.");
48 }
49 range = `^${range}.0.0-0`;
50 }
51 if (typeof range !== "string") {
52 throw new Error("Expected string or integer value.");
53 }
54 const limit = Error.stackTraceLimit;
55 if (typeof limit === "number" && limit < 25) {
56 Error.stackTraceLimit = 25;
57 }
58 let err;
59 if (version.startsWith("7.")) {
60 err = new Error(`Requires Babel "^7.0.0-beta.41", but was loaded with "${version}". ` + `You'll need to update your @babel/core version.`);
61 } else {
62 err = new Error(`Requires Babel "${range}", but was loaded with "${version}". ` + `If you are sure you have a compatible version of @babel/core, ` + `it is likely that something in your build process is loading the ` + `wrong version. Inspect the stack trace of this error to look for ` + `the first entry that doesn't mention "@babel/core" or "babel-core" ` + `to see what is calling Babel.`);
63 }
64 if (typeof limit === "number") {
65 Error.stackTraceLimit = limit;
66 }
67 throw Object.assign(err, {
68 code: "BABEL_VERSION_UNSUPPORTED",
69 version,
70 range
71 });
72}
73
74//# sourceMappingURL=index.js.map
Note: See TracBrowser for help on using the repository browser.