Function generateSegments

  • Generate a String with Random Segments

    Parameters

    • segments: number[]
    • seperator: string = '-'
    • Optional options: {
          exclude?: string[];
          lowercase?: boolean;
          numbers?: boolean;
          symbols?: boolean;
          uppercase?: boolean;
      }
      • Optional exclude?: string[]

        Letters / Symbols that shouldnt be included

        Default

        []
        

        Since

        1.0.0

      • Optional lowercase?: boolean

        Whether Lowercase Letters should be included

        Default

        true
        

        Since

        1.0.0

      • Optional numbers?: boolean

        Whether Numbers should be included

        Default

        true
        

        Since

        1.0.0

      • Optional symbols?: boolean

        Whether Symbols should be included

        Default

        false
        

        Since

        1.0.0

      • Optional uppercase?: boolean

        Whether Uppercase Letters should be included

        Default

        true
        

        Since

        1.0.0

    Returns string

    Example

    import { string } from "@rjweb/utils"

    string.generateSegments([2, 5, 3], '-', { numbers: true, ... }) // dK-4Rflk-jGb

    Since

    1.0.0

    Supports

    nodejs, browser