lanka-validations - v2.1.0
    Preparing search index...

    Function cleanString

    • Trims strings and removes zero-width spaces/BOMs. Accepts finite numbers explicitly; rejects other types without invoking user-defined coercion.

      Parameters

      • input: unknown

        Any value.

      Returns string

      The trimmed string without zero-width characters, a finite number as text, or '' for anything else or strings over 1,024 characters.

      cleanString('  921234567V '); // '921234567V'
      cleanString(42); // '42'
      cleanString({}); // ''