Function iter

  • Generates a list of urls from a given pattern. [0-12] will be replaced with numbers from 0 to 12. [001-999] will be replaced with numbers from 001 to 999 (padded). {one|two} will be replaced with "one" and "two".

    You can mix these patterns.

    Order is undefined and may change in the future.

    Example

    const urls = iter("https://example.com/[1-2]/page[01-11]?q={one|two}");
    // result:
    [
    "https://example.com/1/page01?q=one",
    "https://example.com/1/page01?q=two",
    "https://example.com/1/page02?q=one",
    "https://example.com/1/page02?q=two",
    // and so on
    ]

    Returns

    the list of urls

    Parameters

    • url: string

      url pattern

    Returns string[]

Generated using TypeDoc