convnum
    Preparing search index...

    Function hasType

    • Checks if a string has a specific type among all supported types in this library

      Parameters

      • str: string

        The input string to check

      • targetType: NumType

        The specific type to check for (e.g., 'decimal', 'roman', 'latin_letter')

      Returns boolean

      True if the string has the specified type, false otherwise

      hasType('123', 'decimal') // returns true
      hasType('IV', 'roman') // returns true
      hasType('A', 'latin_letter') // returns true
      hasType('invalid', 'roman') // returns false
      hasType('', 'empty') // returns true
      hasType('xyz123', 'unknown') // returns true
      hasType(null, 'invalid') // returns true