ChemPal Documentation - v1.6.0
    Preparing search index...
    • Type guard to validate if a value is a usable IUPAC name (a non-empty string).

      Parameters

      • value: unknown

        The value to validate

      Returns value is IupacName<string>

      Type predicate indicating if the value is a valid IUPAC name

      isIupacName("dipotassium;oxalate") // Returns true
      isIupacName("") // Returns false
      export function isIupacName(value: unknown): value is IupacName<string> {
      return typeof value === 'string' && value.trim().length > 0;
      }