Skip to content

Commit

Permalink
Document isSubType
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Apr 11, 2024
1 parent c15b6e0 commit dd9af46
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/src/components/Datatypes/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export class DatatypesMapperModel {
this.datatypesMapping = typesAndMapping.datatypes_mapping;
}

/**
* Checks if a given child datatype is a subtype of a parent datatype.
* @param child - The child datatype extension as registered in the datatypes registry.
* @param parent - The parent datatype, which can be an extension or explicit class name
* Can also be used with extensionless abstract datatypes (e.g. "galaxy.datatypes.images.Image")
* @returns A boolean indicating whether the child is a subtype of the parent.
*/
isSubType(child: string, parent: string): boolean {
const mapping = this.datatypesMapping;
const childClassName = mapping.ext_to_class_name[child];
Expand Down

0 comments on commit dd9af46

Please sign in to comment.