1 |
|
2 |
|
3 |
|
4 |
|
5 | 'use strict';
|
6 | const compareLocations = require('./compareLocations');
|
7 |
|
8 | class Dependency {
|
9 | constructor() {
|
10 | this.module = null;
|
11 | }
|
12 |
|
13 | isEqualResource() {
|
14 | return false;
|
15 | }
|
16 |
|
17 |
|
18 | getReference() {
|
19 | if (!this.module) return null;
|
20 | return {
|
21 | module: this.module,
|
22 | importedNames: true,
|
23 | };
|
24 | }
|
25 |
|
26 |
|
27 | getExports() {
|
28 | return null;
|
29 | }
|
30 |
|
31 | getWarnings() {
|
32 | return null;
|
33 | }
|
34 |
|
35 | getErrors() {
|
36 | return null;
|
37 | }
|
38 |
|
39 | updateHash(hash) {
|
40 | hash.update((this.module && this.module.id) + '');
|
41 | }
|
42 |
|
43 | disconnect() {
|
44 | this.module = null;
|
45 | }
|
46 |
|
47 |
|
48 | compare(a, b) {
|
49 | return compareLocations(a.loc, b.loc);
|
50 | }
|
51 | }
|
52 | Dependency.compare = (a, b) => compareLocations(a.loc, b.loc);
|
53 |
|
54 | module.exports = Dependency;
|