Function generateRandomString

  • Generate a random string value

    Parameters

    • config: {
          chars: undefined | string;
          length: undefined | number;
      } = {}

      a list of parameters containing a number length (default : 10) and a string chars (default : abcde...) that define bounds on the generator.

      • chars: undefined | string

        the characters to use to generate the string

      • length: undefined | number

        the length of the generated string

    Returns string

    generateRandomString({ length: 3, chars: "abc"}); // -> "aca"