inferCategoryFromType function exported ✓ 100.0%

Last updated: 2026-02-24T21:07:57.585Z

Metrics

LOC: 9 Complexity: 3 Params: 1 Coverage: 100.0% (3/3 lines, 3x executed)

Signature

inferCategoryFromType(type: FieldType): : FieldCategory

Summary

Maps a {@link FieldType} to its canonical {@link FieldCategory}.

Source Code

export function inferCategoryFromType(type: FieldType): FieldCategory {
  for (const [category, types] of Object.entries(
    FIELD_TYPES_BY_CATEGORY,
  ) as Array<[FieldCategory, FieldType[]]>) {
    if (types.includes(type)) return category;
  }

  return "unknown";
}

No outgoing dependencies.

Impact (Incoming)

graph LR inferCategoryFromType["inferCategoryFromType"] TrainingProgress["TrainingProgress"] PretrainedState["PretrainedState"] TrainingProgress -->|uses| inferCategoryFromType PretrainedState -->|uses| inferCategoryFromType style inferCategoryFromType fill:#dbeafe,stroke:#2563eb,stroke-width:2px click inferCategoryFromType "db1fbd205abd3936.html" click TrainingProgress "d4b62d289bd259d5.html" click PretrainedState "5cefc72e50bf5399.html"
SourceType
TrainingProgress uses
PretrainedState uses