You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The qualifier is used to distinguish capabilities of the same type. It was originally designed as a dictionary, primarily to support the passing of identifiers. However, the qualifier is now static (i.e., no longer supports wildcard values), and identifiers are passed as parameters.
Therefore, consider changing the qualifier to a list of distinct labels instead of a key-value structure. Then, finding a reasonable dictionary key often turned out to be tricky.
Actual structure: qualifier: {[key: string]: string | number | boolean}
Proposed change: qualifier: string | Set<string>
The text was updated successfully, but these errors were encountered:
Distinct arrays as type is probably better than Set because you don't need to carry all methods from Sets. You're just interested in data container with distinct values. Such type can be defined e.g. as follows: https://tompicton.com/typescript-distinct-array/
Means:
qualifier: string|DistinctArray<string>
The same for Map. Why to model a data structure as "heavyweight" Map if you only need a dictionary?
Hey @ova2,
Thank you for your suggestion. The type definition for DistinctArray is quite complex and is hard to read especially for the users of the API. I am unsure if the added complexity outweights the disadvantages of simply using Sets. Furthermore, since qualifiers are defined in the manifest.json file, only array types are supported anyways. We might just define the qualifier as such:
Hey @ova2, Thank you for your suggestion. The type definition for DistinctArray is quite complex and is hard to read especially for the users of the API. I am unsure if the added complexity outweights the disadvantages of simply using Sets. Furthermore, since qualifiers are defined in the manifest.json file, only array types are supported anyways. We might just define the qualifier as such:
The qualifier is used to distinguish capabilities of the same type. It was originally designed as a dictionary, primarily to support the passing of identifiers. However, the qualifier is now static (i.e., no longer supports wildcard values), and identifiers are passed as parameters.
Therefore, consider changing the qualifier to a list of distinct labels instead of a key-value structure. Then, finding a reasonable dictionary key often turned out to be tricky.
Actual structure:
qualifier: {[key: string]: string | number | boolean}
Proposed change:
qualifier: string | Set<string>
The text was updated successfully, but these errors were encountered: