get_component_type
Stable function · Editing
Tier: stable · Kind: function · Topic: Editing
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
| not exported | getComponentType | not exported | get_component_type | not exported |
Julia
Julia does not export this function.
TypeScript
function getComponentType(esmFile: EsmFile, componentId: string): ComponentNode['type'] | null
Get the type of a component by its ID
Python
Python does not export this function.
Rust
pub fn get_component_type(esm_file: &EsmFile, component_id: &str) -> Option<ComponentType>
Get the type of a component
A data_sources id is NOT a component (esm-libraries-spec §4.8.1) and
resolves to None.
Arguments
esm_file- The ESM file to checkcomponent_id- The component ID to look for
Returns
Some(ComponentType)if the component existsNoneif the component doesn’t exist
Go
Go does not export this function.