1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.isMultiResult = exports.isMultiSubProject = exports.adaptSingleProjectPlugin = void 0;
|
4 | function adaptSingleProjectPlugin(plugin) {
|
5 | return { inspect: (root, targetFile, options) => {
|
6 | if (options && isMultiSubProject(options)) {
|
7 | const name = plugin.pluginName ? plugin.pluginName() : '[unknown]';
|
8 | throw new Error(`Plugin ${name} does not support scanning multiple sub-projects`);
|
9 | }
|
10 | else {
|
11 | return plugin.inspect(root, targetFile, options);
|
12 | }
|
13 | } };
|
14 | }
|
15 | exports.adaptSingleProjectPlugin = adaptSingleProjectPlugin;
|
16 | function isMultiSubProject(options) {
|
17 | return options.allSubProjects;
|
18 | }
|
19 | exports.isMultiSubProject = isMultiSubProject;
|
20 | function isMultiResult(res) {
|
21 | return !!res.scannedProjects;
|
22 | }
|
23 | exports.isMultiResult = isMultiResult;
|
24 |
|
\ | No newline at end of file |