ChemPal Documentation - v1.17.0
    Preparing search index...

    Function lookupOshaChemical

    • Looks a searched term up in the OSHA OBIS dataset by CAS number, exact name/synonym, or the same words in any order (so "hydroxide sodium" still finds "sodium hydroxide").

      Parameters

      • term: string

        A chemical name or CAS number.

      Returns Promise<undefined | OshaChemical>

      The matching record, or undefined when OBIS has none or is unavailable.

      await lookupOshaChemical('67-64-1'); // { name: "ACETONE", nfpaHealth: "1", ... }
      await lookupOshaChemical('hydroxide sodium'); // { name: "SODIUM HYDROXIDE", ... }
      export async function lookupOshaChemical(term: string): Promise<OshaChemical | undefined> {
      const index = await loadOshaIndex();
      if (index === undefined) return undefined;
      const trimmed = term.trim();
      if (isCAS(trimmed)) return index.byCas.get(trimmed);
      const key = normalizeChemicalName(trimmed);
      return index.byName.get(key) ?? index.byTokens.get(key.split(' ').sort().join(' '));
      }