1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.VirtualResolver = void 0;
|
4 | class VirtualResolver {
|
5 | static isVirtualDescriptor(descriptor) {
|
6 | if (!descriptor.range.startsWith(VirtualResolver.protocol))
|
7 | return false;
|
8 | return true;
|
9 | }
|
10 | static isVirtualLocator(locator) {
|
11 | if (!locator.reference.startsWith(VirtualResolver.protocol))
|
12 | return false;
|
13 | return true;
|
14 | }
|
15 | supportsDescriptor(descriptor, opts) {
|
16 | return VirtualResolver.isVirtualDescriptor(descriptor);
|
17 | }
|
18 | supportsLocator(locator, opts) {
|
19 | return VirtualResolver.isVirtualLocator(locator);
|
20 | }
|
21 | shouldPersistResolution(locator, opts) {
|
22 | return false;
|
23 | }
|
24 | bindDescriptor(descriptor, locator, opts) {
|
25 |
|
26 |
|
27 |
|
28 | throw new Error(`Assertion failed: calling "bindDescriptor" on a virtual descriptor is unsupported`);
|
29 | }
|
30 | getResolutionDependencies(descriptor, opts) {
|
31 |
|
32 |
|
33 |
|
34 | throw new Error(`Assertion failed: calling "getResolutionDependencies" on a virtual descriptor is unsupported`);
|
35 | }
|
36 | async getCandidates(descriptor, dependencies, opts) {
|
37 |
|
38 |
|
39 |
|
40 | throw new Error(`Assertion failed: calling "getCandidates" on a virtual descriptor is unsupported`);
|
41 | }
|
42 | async getSatisfying(descriptor, candidates, opts) {
|
43 |
|
44 |
|
45 |
|
46 | throw new Error(`Assertion failed: calling "getSatisfying" on a virtual descriptor is unsupported`);
|
47 | }
|
48 | async resolve(locator, opts) {
|
49 |
|
50 |
|
51 |
|
52 | throw new Error(`Assertion failed: calling "resolve" on a virtual locator is unsupported`);
|
53 | }
|
54 | }
|
55 | exports.VirtualResolver = VirtualResolver;
|
56 | VirtualResolver.protocol = `virtual:`;
|