Version: dev

get_component_type

Stable function · Editing

Tier: stable · Kind: function · Topic: Editing

JuliaTypeScriptPythonRustGo
not exportedgetComponentTypenot exportedget_component_typenot 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

Source

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 check
  • component_id - The component ID to look for

Returns

  • Some(ComponentType) if the component exists
  • None if the component doesn’t exist

Source · Rust docs

Go

Go does not export this function.