Skip to content
Compare
Choose a tag to compare
@github-actions github-actions released this 25 Nov 09:15
· 243 commits to main since this release
47026d4

Minor Changes

  • #1333 734a62d Thanks @mrlubos! - feat: add buildUrl() method

    Build URL

    ::: warning
    To use this feature, you must opt in to the experimental parser.
    :::

    If you need to access the compiled URL, you can use the buildUrl() method. It's loosely typed by default to accept almost any value; in practice, you will want to pass a type hint.

    type FooData = {
      path: {
        fooId: number;
      };
      query?: {
        bar?: string;
      };
      url: '/foo/{fooId}';
    };
    
    const url = client.buildUrl<FooData>({
      path: {
        fooId: 1,
      },
      query: {
        bar: 'baz',
      },
      url: '/foo/{fooId}',
    });
    console.log(url); // prints '/foo/1?bar=baz'

Patch Changes