UNPKG

994 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7class BaseParser {
8 constructor() {
9 this.sawUnambiguousESM = false;
10 this.ambiguousScriptDifferentAst = false;
11 }
12 hasPlugin(pluginConfig) {
13 if (typeof pluginConfig === "string") {
14 return this.plugins.has(pluginConfig);
15 } else {
16 const [pluginName, pluginOptions] = pluginConfig;
17 if (!this.hasPlugin(pluginName)) {
18 return false;
19 }
20 const actualOptions = this.plugins.get(pluginName);
21 for (const key of Object.keys(pluginOptions)) {
22 if ((actualOptions == null ? void 0 : actualOptions[key]) !== pluginOptions[key]) {
23 return false;
24 }
25 }
26 return true;
27 }
28 }
29 getPluginOption(plugin, name) {
30 var _this$plugins$get;
31 return (_this$plugins$get = this.plugins.get(plugin)) == null ? void 0 : _this$plugins$get[name];
32 }
33}
34exports.default = BaseParser;
35
36//# sourceMappingURL=base.js.map