jmap-kit
    Preparing search index...

    Function idGenerator

    • A generator function that produces unique IDs with an optional prefix. The IDs are generated as strings of incrementing BigInt values, starting from a specified initial value (default is 0). This is used for generating unique identifiers for method calls by the by the RequestBuilder.

      Parameters

      • prefix: string = ""

        The prefix to prepend to each generated ID.

      • start: string | number | bigint | boolean = 0

        The initial value for the ID counter.

      Returns Generator<Id, never, never>

      A generator that yields unique IDs as strings with the specified prefix.

      const gen = idGenerator("c");
      console.log(gen.next().value); // "c0"
      console.log(gen.next().value); // "c1"
      console.log(gen.next().value); // "c2"