@@ -29,6 +29,8 @@ export interface Protocol {
29
29
supportsHashValue : ( hv : HashContent | any ) => boolean
30
30
31
31
supportsExternalReferenceType : ( ert : ExternalReferenceType | any ) => boolean
32
+
33
+ readonly supportsDependencyGraph : boolean
32
34
}
33
35
34
36
class Spec implements Protocol {
@@ -38,21 +40,24 @@ class Spec implements Protocol {
38
40
readonly #hashAlgorithms: ReadonlySet < HashAlgorithm >
39
41
readonly #hashValuePattern: RegExp
40
42
readonly #externalReferenceTypes: ReadonlySet < ExternalReferenceType >
43
+ readonly #supportsDependencyGraph: boolean
41
44
42
45
constructor (
43
46
version : Version ,
44
47
formats : Iterable < Format > ,
45
48
componentTypes : Iterable < ComponentType > ,
46
49
hashAlgorithms : Iterable < HashAlgorithm > ,
47
50
hashValuePattern : RegExp ,
48
- externalReferenceTypes : Iterable < ExternalReferenceType >
51
+ externalReferenceTypes : Iterable < ExternalReferenceType > ,
52
+ supportsDependencyGraph : boolean
49
53
) {
50
54
this . #version = version
51
55
this . #formats = new Set ( formats )
52
56
this . #componentTypes = new Set ( componentTypes )
53
57
this . #hashAlgorithms = new Set ( hashAlgorithms )
54
58
this . #hashValuePattern = hashValuePattern
55
59
this . #externalReferenceTypes = new Set ( externalReferenceTypes )
60
+ this . #supportsDependencyGraph = supportsDependencyGraph
56
61
}
57
62
58
63
get version ( ) : Version {
@@ -79,6 +84,10 @@ class Spec implements Protocol {
79
84
supportsExternalReferenceType ( ert : ExternalReferenceType | any ) : boolean {
80
85
return this . #externalReferenceTypes. has ( ert )
81
86
}
87
+
88
+ get supportsDependencyGraph ( ) : boolean {
89
+ return this . #supportsDependencyGraph
90
+ }
82
91
}
83
92
84
93
/** Specification v1.2 */
@@ -129,7 +138,8 @@ export const Spec1dot2: Protocol = Object.freeze(new Spec(
129
138
ExternalReferenceType . BuildMeta ,
130
139
ExternalReferenceType . BuildSystem ,
131
140
ExternalReferenceType . Other
132
- ]
141
+ ] ,
142
+ true
133
143
) )
134
144
135
145
/** Specification v1.3 */
@@ -180,7 +190,8 @@ export const Spec1dot3: Protocol = Object.freeze(new Spec(
180
190
ExternalReferenceType . BuildMeta ,
181
191
ExternalReferenceType . BuildSystem ,
182
192
ExternalReferenceType . Other
183
- ]
193
+ ] ,
194
+ true
184
195
) )
185
196
186
197
/** Specification v1.4 */
@@ -232,7 +243,8 @@ export const Spec1dot4: Protocol = Object.freeze(new Spec(
232
243
ExternalReferenceType . BuildSystem ,
233
244
ExternalReferenceType . ReleaseNotes ,
234
245
ExternalReferenceType . Other
235
- ]
246
+ ] ,
247
+ true
236
248
) )
237
249
238
250
export const SpecVersionDict : { readonly [ key in Version ] ?: Protocol } = Object . freeze ( Object . fromEntries ( [
0 commit comments